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 @@ -47,8 +47,18 @@ void deepsleep(void)
47
47
// Stop HAL systick
48
48
HAL_SuspendTick ();
49
49
50
- // Request to enter STOP mode with regulator in low power mode
51
- HAL_PWR_EnterSTOPMode (PWR_LOWPOWERREGULATOR_ON , PWR_STOPENTRY_WFI );
50
+ // Request to enter STOP mode 1 with regulator in low power mode
51
+ if (__HAL_RCC_PWR_IS_CLK_ENABLED ()) {
52
+ HAL_PWREx_EnableLowPowerRunMode ();
53
+ HAL_PWR_EnterSTOPMode (PWR_LOWPOWERREGULATOR_ON , PWR_STOPENTRY_WFI );
54
+ HAL_PWREx_DisableLowPowerRunMode ();
55
+ } else {
56
+ __HAL_RCC_PWR_CLK_ENABLE ();
57
+ HAL_PWREx_EnableLowPowerRunMode ();
58
+ HAL_PWR_EnterSTOPMode (PWR_LOWPOWERREGULATOR_ON , PWR_STOPENTRY_WFI );
59
+ HAL_PWREx_DisableLowPowerRunMode ();
60
+ __HAL_RCC_PWR_CLK_DISABLE ();
61
+ }
52
62
53
63
// After wake-up from STOP reconfigure the PLL
54
64
SetSysClock ();
You can’t perform that action at this time.
0 commit comments