Skip to content

Commit

Permalink
STM32L4 : sleep issue
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromecoutant committed Oct 15, 2018
1 parent 8bf51be commit 7b605b6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions targets/TARGET_STM/sleep.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 7b605b6

Please sign in to comment.