mbed library sources
Dependents: frdm_kl05z_gpio_test
Fork of mbed-src by
Diff: targets/hal/TARGET_STM/TARGET_DISCO_F051R8/sleep.c
- Revision:
- 240:9a7c54113eaf
- Parent:
- 130:1dec54e4aec3
--- a/targets/hal/TARGET_STM/TARGET_DISCO_F051R8/sleep.c Thu Jun 26 09:15:07 2014 +0100 +++ b/targets/hal/TARGET_STM/TARGET_DISCO_F051R8/sleep.c Thu Jun 26 09:45:08 2014 +0100 @@ -28,10 +28,12 @@ ******************************************************************************* */ #include "sleep_api.h" + +#if DEVICE_SLEEP + #include "cmsis.h" -void sleep(void) -{ +void sleep(void) { // Disable us_ticker update interrupt TIM_ITConfig(TIM1, TIM_IT_Update, DISABLE); @@ -44,11 +46,15 @@ // MCU STOP mode // Wake-up with external interrupt -void deepsleep(void) -{ +void deepsleep(void) { // Enable PWR clock RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR, ENABLE); // Request to enter STOP mode with regulator in low power mode PWR_EnterSTOPMode(PWR_Regulator_LowPower, PWR_STOPEntry_WFI); + + // After wake-up from STOP reconfigure the PLL + SetSysClock(); } + +#endif