Commit 68bd0369 authored by Andrzej Głąbek's avatar Andrzej Głąbek Committed by Carles Cufi
Browse files

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: default avatarAndrzej Głąbek <andrzej.glabek@nordicsemi.no>
parent 0f71a130
Loading
Loading
Loading
Loading
+1 −12
Original line number Diff line number Diff line
@@ -291,18 +291,7 @@ static int entropy_nrf5_get_entropy_isr(const struct device *dev,

			while (!nrf_rng_event_check(NRF_RNG,
						    NRF_RNG_EVENT_VALRDY)) {
				/*
				 * 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();
				k_cpu_atomic_idle(irq_lock());
			}

			byte = random_byte_get();