You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by an...@apache.org on 2017/10/19 15:04:53 UTC

[mynewt-core] 02/02: Removing use of undefined TASKS_START behavior

This is an automated email from the ASF dual-hosted git repository.

andk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git

commit 0a1569b315ce3d2ef772343cbc30aa4e843b2626
Author: Jonathan Seroussi <se...@gmail.com>
AuthorDate: Tue Oct 17 16:55:40 2017 +0300

    Removing use of undefined TASKS_START behavior
    
    This is a follow up commit to a the same fix in the nRF52. Tested using the bleprph app - but only on an emulator. Seems to be working the same as before. Happy to help testing further!
    
    The problem was that the behavior of the RNG TASKS_START is defined to be write only. Reading from it is undefined and though it might have worked up until now doesn't mean it'll constantly work. I was only able to catch on to this using an emulator.
---
 hw/drivers/nimble/nrf51/src/ble_hw.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/hw/drivers/nimble/nrf51/src/ble_hw.c b/hw/drivers/nimble/nrf51/src/ble_hw.c
index c9e6989..e9b5040 100644
--- a/hw/drivers/nimble/nrf51/src/ble_hw.c
+++ b/hw/drivers/nimble/nrf51/src/ble_hw.c
@@ -340,13 +340,11 @@ ble_hw_rng_start(void)
 
     /* No need for interrupt if there is no callback */
     OS_ENTER_CRITICAL(sr);
-    if (NRF_RNG->TASKS_START == 0) {
-        NRF_RNG->EVENTS_VALRDY = 0;
-        if (g_ble_rng_isr_cb) {
-            NRF_RNG->INTENSET = 1;
-        }
-        NRF_RNG->TASKS_START = 1;
+    NRF_RNG->EVENTS_VALRDY = 0;
+    if (g_ble_rng_isr_cb) {
+        NRF_RNG->INTENSET = 1;
     }
+    NRF_RNG->TASKS_START = 1;
     OS_EXIT_CRITICAL(sr);
 
     return 0;

-- 
To stop receiving notification emails like this one, please contact
"commits@mynewt.apache.org" <co...@mynewt.apache.org>.