File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -55,17 +55,21 @@ void hal_deepsleep(void)
55
55
int pwrClockEnabled = __HAL_RCC_PWR_IS_CLK_ENABLED ();
56
56
int lowPowerModeEnabled = PWR -> CR1 & PWR_CR1_LPR ;
57
57
58
- if (!pwrClockEnabled )
58
+ if (!pwrClockEnabled ) {
59
59
__HAL_RCC_PWR_CLK_ENABLE ();
60
- if (lowPowerModeEnabled )
60
+ }
61
+ if (lowPowerModeEnabled ) {
61
62
HAL_PWREx_DisableLowPowerRunMode ();
63
+ }
62
64
63
65
HAL_PWREx_EnterSTOP2Mode (PWR_STOPENTRY_WFI );
64
66
65
- if (lowPowerModeEnabled )
67
+ if (lowPowerModeEnabled ) {
66
68
HAL_PWREx_EnableLowPowerRunMode ();
67
- if (!pwrClockEnabled )
69
+ }
70
+ if (!pwrClockEnabled ) {
68
71
__HAL_RCC_PWR_CLK_DISABLE ();
72
+ }
69
73
#else /* TARGET_STM32L4 */
70
74
HAL_PWR_EnterSTOPMode (PWR_LOWPOWERREGULATOR_ON , PWR_STOPENTRY_WFI );
71
75
#endif /* TARGET_STM32L4 */
You can’t perform that action at this time.
0 commit comments