diff options
Diffstat (limited to 'nuttx/arch/arm/src/stm32/stm32_pmstop.c')
-rw-r--r-- | nuttx/arch/arm/src/stm32/stm32_pmstop.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/nuttx/arch/arm/src/stm32/stm32_pmstop.c b/nuttx/arch/arm/src/stm32/stm32_pmstop.c index c68885611..9bd4af73a 100644 --- a/nuttx/arch/arm/src/stm32/stm32_pmstop.c +++ b/nuttx/arch/arm/src/stm32/stm32_pmstop.c @@ -107,8 +107,16 @@ int stm32_pmstop(bool lpds) regval |= NVIC_SYSCON_SLEEPDEEP; putreg32(regval, NVIC_SYSCON); - /* Sleep until the wakeup interrupt occurs (us WFE to wait for an event) */ + /* Sleep until the wakeup interrupt or event occurs */ - asm("WFI"); +#ifdef CONFIG_PM_WFE + /* Mode: SLEEP + Entry with WFE */ + + __asm("wfe"); +#else + /* Mode: SLEEP + Entry with WFI */ + + __asm("wfi"); +#endif return OK; } |