drivers: entropy_nrf5: Eliminate direct use of WFE instructions

Use the appropriate kernel function, i.e. `k_cpu_atomic_idle()`,
instead of directly executing the WFE instruction.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
This commit is contained in:
Andrzej Głąbek 2023-02-21 08:13:53 +01:00 committed by Carles Cufí
commit 68bd036947

View file

@ -291,18 +291,7 @@ static int entropy_nrf5_get_entropy_isr(const struct device *dev,
while (!nrf_rng_event_check(NRF_RNG, while (!nrf_rng_event_check(NRF_RNG,
NRF_RNG_EVENT_VALRDY)) { NRF_RNG_EVENT_VALRDY)) {
/* k_cpu_atomic_idle(irq_lock());
* To guarantee waking up from the event, the
* SEV-On-Pend feature must be enabled (enabled
* during ARCH initialization).
*
* DSB is recommended by spec before WFE (to
* guarantee completion of memory transactions)
*/
__DSB();
__WFE();
__SEV();
__WFE();
} }
byte = random_byte_get(); byte = random_byte_get();