File tree Expand file tree Collapse file tree 1 file changed +4
-13
lines changed Expand file tree Collapse file tree 1 file changed +4
-13
lines changed Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ static void wait_loop(uint32_t timeout)
52
52
53
53
54
54
// On L4 platforms we've seen unstable PLL CLK configuraiton
55
- // when DEEP SLEEP exits just few µs after being entered
55
+ // when DEEP SLEEP exits just few µs after being entered
56
56
// So we need to force MSI usage before setting clocks again
57
57
static void ForcePeriphOutofDeepSleep (void )
58
58
{
@@ -162,19 +162,10 @@ void hal_sleep(void)
162
162
// [5.4.1 Power control register 1 (PWR_CR1)]
163
163
// LPR: When this bit is set, the regulator is switched from main mode (MR) to low-power mode (LPR).
164
164
int lowPowerMode = PWR -> CR1 & PWR_CR1_LPR ;
165
-
166
- // LPR -> Run
167
165
if (lowPowerMode ) {
168
- HAL_PWREx_DisableLowPowerRunMode ();
169
- }
170
-
171
- // Entering Sleep mode [5.3.4 Sleep mode]
172
- CLEAR_BIT (SCB -> SCR , ((uint32_t )SCB_SCR_SLEEPDEEP_Msk )); // SLEEPDEEP = 0
173
- __WFI ();
174
-
175
- // Run -> LPR
176
- if (lowPowerMode ) {
177
- HAL_PWREx_EnableLowPowerRunMode ();
166
+ HAL_PWR_EnterSLEEPMode (PWR_MAINREGULATOR_ON , PWR_SLEEPENTRY_WFI );
167
+ } else {
168
+ HAL_PWR_EnterSLEEPMode (PWR_LOWPOWERREGULATOR_ON , PWR_SLEEPENTRY_WFI );
178
169
}
179
170
#else
180
171
HAL_PWR_EnterSLEEPMode (PWR_MAINREGULATOR_ON , PWR_SLEEPENTRY_WFI );
You can’t perform that action at this time.
0 commit comments