mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #13817 from facchinm/patch_lse_bypass
STM32: define RCC_LSE_BYPASS to allow using PC_15 as gpiopull/13841/head
commit
798c3c5f4f
|
@ -170,7 +170,11 @@ void lp_ticker_init(void)
|
||||||
|
|
||||||
/* Enable LSE clock */
|
/* Enable LSE clock */
|
||||||
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSE;
|
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSE;
|
||||||
|
#if MBED_CONF_TARGET_LSE_BYPASS
|
||||||
|
RCC_OscInitStruct.LSEState = RCC_LSE_BYPASS;
|
||||||
|
#else
|
||||||
RCC_OscInitStruct.LSEState = RCC_LSE_ON;
|
RCC_OscInitStruct.LSEState = RCC_LSE_ON;
|
||||||
|
#endif
|
||||||
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
|
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
|
||||||
|
|
||||||
/* Select the LSE clock as LPTIM peripheral clock */
|
/* Select the LSE clock as LPTIM peripheral clock */
|
||||||
|
|
|
@ -65,7 +65,11 @@ void rtc_init(void)
|
||||||
#if MBED_CONF_TARGET_LSE_AVAILABLE
|
#if MBED_CONF_TARGET_LSE_AVAILABLE
|
||||||
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSE;
|
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSE;
|
||||||
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
|
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
|
||||||
|
#if MBED_CONF_TARGET_LSE_BYPASS
|
||||||
|
RCC_OscInitStruct.LSEState = RCC_LSE_BYPASS;
|
||||||
|
#else
|
||||||
RCC_OscInitStruct.LSEState = RCC_LSE_ON;
|
RCC_OscInitStruct.LSEState = RCC_LSE_ON;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) {
|
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) {
|
||||||
error("Cannot initialize RTC with LSE\n");
|
error("Cannot initialize RTC with LSE\n");
|
||||||
|
|
Loading…
Reference in New Issue