Skip to content

Commit bc84c03

Browse files
U-owner-PC\ownerU-owner-PC\owner
authored andcommitted
handle HSE-PLL enabled upone deepsleep wakeup
1 parent 11bfe69 commit bc84c03

File tree

1 file changed

+4
-1
lines changed
  • libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32L1/TARGET_MOTE_L152RC

1 file changed

+4
-1
lines changed

libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32L1/TARGET_MOTE_L152RC/system_stm32l1xx.c

100644100755
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@
125125
*/
126126

127127
/* Select the clock sources (other than HSI) to start with (0=OFF, 1=ON) */
128-
#define USE_PLL_HSE_EXTC (1) /* Use external clock */
128+
#define USE_PLL_HSE_EXTC (0) /* Use external clock */
129129
#define USE_PLL_HSE_XTAL (1) /* Use external xtal */
130130

131131
/**
@@ -485,6 +485,9 @@ uint8_t SetSysClock_PLL_HSE(uint8_t bypass)
485485
RCC_ClkInitTypeDef RCC_ClkInitStruct;
486486
RCC_OscInitTypeDef RCC_OscInitStruct;
487487

488+
if (__HAL_RCC_GET_SYSCLK_SOURCE() == RCC_CFGR_SWS_PLL)
489+
return 1; // already on HSE PLL, could occur from deepsleep waking
490+
488491
/* Used to gain time after DeepSleep in case HSI is used */
489492
if (__HAL_RCC_GET_FLAG(RCC_FLAG_HSIRDY) != RESET)
490493
{

0 commit comments

Comments
 (0)