From 6400747699d1d94e08a3b590806d736f60925025 Mon Sep 17 00:00:00 2001 From: Jonathan Seroussi Date: Sun, 15 Oct 2017 14:58:14 +0300 Subject: [PATCH] Removing use of undefined TASKS_START behavior Tested using the bleprph app. 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. X-Original-Commit: fc0da53f8abedb1c7fce4e35ee565e310e971fdb --- nimble/drivers/nrf52/src/ble_hw.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/nimble/drivers/nrf52/src/ble_hw.c b/nimble/drivers/nrf52/src/ble_hw.c index b97a347bd..e63ba52e0 100644 --- a/nimble/drivers/nrf52/src/ble_hw.c +++ b/nimble/drivers/nrf52/src/ble_hw.c @@ -344,13 +344,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;