From 7b605b61609ecdeef370457f0e815a8f2f5c5c96 Mon Sep 17 00:00:00 2001 From: jeromecoutant Date: Mon, 15 Oct 2018 10:19:42 +0200 Subject: [PATCH] STM32L4 : sleep issue --- targets/TARGET_STM/sleep.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/targets/TARGET_STM/sleep.c b/targets/TARGET_STM/sleep.c index 0d71fcc93a2..99dc8a62165 100644 --- a/targets/TARGET_STM/sleep.c +++ b/targets/TARGET_STM/sleep.c @@ -163,9 +163,9 @@ void hal_sleep(void) // LPR: When this bit is set, the regulator is switched from main mode (MR) to low-power mode (LPR). int lowPowerMode = PWR->CR1 & PWR_CR1_LPR; if (lowPowerMode) { - HAL_PWR_EnterSLEEPMode(PWR_MAINREGULATOR_ON, PWR_SLEEPENTRY_WFI); - } else { HAL_PWR_EnterSLEEPMode(PWR_LOWPOWERREGULATOR_ON, PWR_SLEEPENTRY_WFI); + } else { + HAL_PWR_EnterSLEEPMode(PWR_MAINREGULATOR_ON, PWR_SLEEPENTRY_WFI); } #else HAL_PWR_EnterSLEEPMode(PWR_MAINREGULATOR_ON, PWR_SLEEPENTRY_WFI);