Merge pull request #13817 from facchinm/patch_lse_bypass

STM32: define RCC_LSE_BYPASS to allow using PC_15 as gpio
pull/13841/head
Martin Kojtal 2020-11-02 14:17:53 +00:00 committed by GitHub
commit 798c3c5f4f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View File

@ -170,7 +170,11 @@ void lp_ticker_init(void)
/* Enable LSE clock */
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;
#endif
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
/* Select the LSE clock as LPTIM peripheral clock */

View File

@ -65,7 +65,11 @@ void rtc_init(void)
#if MBED_CONF_TARGET_LSE_AVAILABLE
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSE;
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;
#endif
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) {
error("Cannot initialize RTC with LSE\n");