Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: STM32L452_Nucleo_ticker
Fork of mbed-dev by
Diff: targets/TARGET_STM/sleep.c
- Revision:
- 156:95d6b41a828b
- Parent:
- 154:37f96f9d4de2
- Child:
- 160:d5399cc887bb
--- a/targets/TARGET_STM/sleep.c Thu Jan 05 10:51:54 2017 +0000 +++ b/targets/TARGET_STM/sleep.c Mon Jan 16 15:03:32 2017 +0000 @@ -52,7 +52,17 @@ // Request to enter STOP mode with regulator in low power mode #if TARGET_STM32L4 - HAL_PWREx_EnterSTOP2Mode(PWR_STOPENTRY_WFI); + if (__HAL_RCC_PWR_IS_CLK_ENABLED()) { + HAL_PWREx_EnableLowPowerRunMode(); + HAL_PWREx_EnterSTOP2Mode(PWR_STOPENTRY_WFI); + HAL_PWREx_DisableLowPowerRunMode(); + } else { + __HAL_RCC_PWR_CLK_ENABLE(); + HAL_PWREx_EnableLowPowerRunMode(); + HAL_PWREx_EnterSTOP2Mode(PWR_STOPENTRY_WFI); + HAL_PWREx_DisableLowPowerRunMode(); + __HAL_RCC_PWR_CLK_DISABLE(); + } #else /* TARGET_STM32L4 */ HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFI); #endif /* TARGET_STM32L4 */