File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
hal/targets/hal/TARGET_STM/TARGET_STM32L4 Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -48,8 +48,18 @@ void deepsleep(void)
48
48
// Stop HAL systick
49
49
HAL_SuspendTick ();
50
50
51
- // Request to enter STOP mode with regulator in low power mode
52
- HAL_PWR_EnterSTOPMode (PWR_LOWPOWERREGULATOR_ON , PWR_STOPENTRY_WFI );
51
+ // Request to enter STOP mode 1 with regulator in low power mode
52
+ if (__HAL_RCC_PWR_IS_CLK_ENABLED ()) {
53
+ HAL_PWREx_EnableLowPowerRunMode ();
54
+ HAL_PWR_EnterSTOPMode (PWR_LOWPOWERREGULATOR_ON , PWR_STOPENTRY_WFI );
55
+ HAL_PWREx_DisableLowPowerRunMode ();
56
+ } else {
57
+ __HAL_RCC_PWR_CLK_ENABLE ();
58
+ HAL_PWREx_EnableLowPowerRunMode ();
59
+ HAL_PWR_EnterSTOPMode (PWR_LOWPOWERREGULATOR_ON , PWR_STOPENTRY_WFI );
60
+ HAL_PWREx_DisableLowPowerRunMode ();
61
+ __HAL_RCC_PWR_CLK_DISABLE ();
62
+ }
53
63
54
64
// After wake-up from STOP reconfigure the PLL
55
65
SetSysClock ();
You can’t perform that action at this time.
0 commit comments