mbed library sources. Supersedes mbed-src. Add PORTG support for STM32L476JG (SensorTile kit)
Fork of mbed-dev by
Diff: targets/hal/TARGET_STM/TARGET_STM32F0/sleep.c
- Revision:
- 148:21d94c44109e
- Parent:
- 144:ef7eb2e8f9f7
--- a/targets/hal/TARGET_STM/TARGET_STM32F0/sleep.c Fri Sep 16 16:24:25 2016 +0100 +++ b/targets/hal/TARGET_STM/TARGET_STM32F0/sleep.c Fri Sep 30 18:07:01 2016 +0100 @@ -28,7 +28,7 @@ ******************************************************************************* */ #include "sleep_api.h" - +#include "rtc_api_hal.h" #if DEVICE_SLEEP @@ -44,28 +44,16 @@ HAL_ResumeTick(); } - -#if defined(TARGET_STM32F030R8) || defined (TARGET_STM32F051R8) -void deepsleep(void) { - // Request to enter STOP mode with regulator in low power mode - HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFI); - - HAL_InitTick(TICK_INT_PRIORITY); - - // After wake-up from STOP reconfigure the PLL - SetSysClock(); - - HAL_InitTick(TICK_INT_PRIORITY); -} - -#else void deepsleep(void) { // Request to enter STOP mode with regulator in low power mode HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFI); // After wake-up from STOP reconfigure the PLL SetSysClock(); + +#if DEVICE_LOWPOWERTIMER + rtc_synchronize(); +#endif } -#endif #endif