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:
parent
0f71a130ef
commit
68bd036947
1 changed files with 1 additions and 12 deletions
|
@ -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();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue