Skip to content

Commit 93f38b2

Browse files
cvinayakrlubos
authored andcommitted
[nrf fromtree] Bluetooth: Controller: Replace WFE use with k_cpu_atomic_idle()
Replace the use of WFE with Zephyr kernel supplied k_cpu_atomic_idle() interface. Signed-off-by: Vinayak Kariappa Chettimada <[email protected]> (cherry picked from commit 3c0c9ac) Signed-off-by: Andrzej Głąbek <[email protected]>
1 parent 9799478 commit 93f38b2

File tree

1 file changed

+3
-17
lines changed
  • subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5

1 file changed

+3
-17
lines changed

subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/cpu.h

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,11 @@
55
* SPDX-License-Identifier: Apache-2.0
66
*/
77

8+
#include <zephyr/kernel.h>
9+
810
static inline void cpu_sleep(void)
911
{
10-
#if defined(CONFIG_CPU_CORTEX_M0) || \
11-
defined(CONFIG_CPU_CORTEX_M4) || \
12-
defined(CONFIG_CPU_CORTEX_M33) || \
13-
defined(CONFIG_SOC_SERIES_BSIM_NRFXX)
14-
/*
15-
* To guarantee waking up from the event, the
16-
* SEV-On-Pend feature must be enabled (enabled
17-
* during ARCH initialization).
18-
*
19-
* DSB is recommended by spec before WFE (to
20-
* guarantee completion of memory transactions)
21-
*/
22-
__DSB();
23-
__WFE();
24-
__SEV();
25-
__WFE();
26-
#endif
12+
k_cpu_atomic_idle(irq_lock());
2713
}
2814

2915
static inline void cpu_dmb(void)

0 commit comments

Comments
 (0)