Skip to content

Commit 461d59a

Browse files
author
Cruz Monrreal
authored
Merge pull request #8427 from jeromecoutant/PR_L4_8343
STM32L4 : sleep issue
2 parents 5c136cc + 7b605b6 commit 461d59a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

targets/TARGET_STM/sleep.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,9 @@ void hal_sleep(void)
163163
// LPR: When this bit is set, the regulator is switched from main mode (MR) to low-power mode (LPR).
164164
int lowPowerMode = PWR->CR1 & PWR_CR1_LPR;
165165
if (lowPowerMode) {
166-
HAL_PWR_EnterSLEEPMode(PWR_MAINREGULATOR_ON, PWR_SLEEPENTRY_WFI);
167-
} else {
168166
HAL_PWR_EnterSLEEPMode(PWR_LOWPOWERREGULATOR_ON, PWR_SLEEPENTRY_WFI);
167+
} else {
168+
HAL_PWR_EnterSLEEPMode(PWR_MAINREGULATOR_ON, PWR_SLEEPENTRY_WFI);
169169
}
170170
#else
171171
HAL_PWR_EnterSLEEPMode(PWR_MAINREGULATOR_ON, PWR_SLEEPENTRY_WFI);

0 commit comments

Comments
 (0)