[NUCLEO_F401RE] Restart PLL after deepsleep

pull/215/head
bcostm 2014-03-19 09:34:30 +01:00
parent 75716e08c5
commit 5963a310e3
2 changed files with 7 additions and 2 deletions

View File

@ -126,7 +126,7 @@
*/ */
/* [ADDED FOR MBED] */ /* [ADDED FOR MBED] */
static void SystemClock_Config(void); void SystemClock_Config(void);
/** /**
* @} * @}
@ -266,7 +266,7 @@ void SystemCoreClockUpdate(void)
/* [ADDED FOR MBED] /* [ADDED FOR MBED]
Configure the System clock to 84 MHz (max value) using the internal HSI 16 MHz clock */ Configure the System clock to 84 MHz (max value) using the internal HSI 16 MHz clock */
static void SystemClock_Config(void) void SystemClock_Config(void)
{ {
RCC_ClkInitTypeDef RCC_ClkInitStruct; RCC_ClkInitTypeDef RCC_ClkInitStruct;
RCC_OscInitTypeDef RCC_OscInitStruct; RCC_OscInitTypeDef RCC_OscInitStruct;

View File

@ -31,6 +31,9 @@
#include "cmsis.h" #include "cmsis.h"
#include "stm32f4xx_hal.h" #include "stm32f4xx_hal.h"
// This function is in the system_stm32f4xx.c file
extern void SystemClock_Config(void);
static TIM_HandleTypeDef TimMasterHandle; static TIM_HandleTypeDef TimMasterHandle;
void sleep(void) void sleep(void)
@ -43,4 +46,6 @@ void deepsleep(void)
{ {
// Request to enter STOP mode with regulator in low power mode // Request to enter STOP mode with regulator in low power mode
HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFI); HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFI);
// After wake-up from STOP reconfigure the PLL
SystemClock_Config();
} }