arch: arm: cortex_m: fix inverted logic in cpu_idle
This mistake was introduced when converting from ASM to C. This change also restores the associated comment from the ASM source. Signed-off-by: Wilfried Chauveau <wilfried.chauveau@arm.com>
This commit is contained in:
parent
5dd1b96847
commit
fb6ab560a5
1 changed files with 5 additions and 1 deletions
|
@ -35,9 +35,13 @@ void z_arm_cpu_idle_init(void)
|
||||||
|
|
||||||
#if defined(CONFIG_ARM_ON_ENTER_CPU_IDLE_HOOK)
|
#if defined(CONFIG_ARM_ON_ENTER_CPU_IDLE_HOOK)
|
||||||
#define SLEEP_IF_ALLOWED(wait_instr) do { \
|
#define SLEEP_IF_ALLOWED(wait_instr) do { \
|
||||||
if (!z_arm_on_enter_cpu_idle()) { \
|
/* Skip the wait instr if on_enter_cpu_idle returns false */ \
|
||||||
|
if (z_arm_on_enter_cpu_idle()) { \
|
||||||
|
/* Wait for all memory transaction to complete */ \
|
||||||
|
/* before entering low power state. */ \
|
||||||
__DSB(); \
|
__DSB(); \
|
||||||
wait_instr(); \
|
wait_instr(); \
|
||||||
|
/* Inline the macro provided by SoC-specific code */ \
|
||||||
ON_EXIT_IDLE_HOOK; \
|
ON_EXIT_IDLE_HOOK; \
|
||||||
} \
|
} \
|
||||||
} while (false)
|
} while (false)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue