mirror of https://github.com/ARMmbed/mbed-os.git
STM32 LOW_POWER_TIMER update : rtc_init procedure
parent
c13ffaf477
commit
85c337d0b9
|
|
@ -55,8 +55,13 @@ void rtc_init(void)
|
|||
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0};
|
||||
|
||||
// Enable access to Backup domain
|
||||
__HAL_RCC_PWR_CLK_ENABLE();
|
||||
HAL_PWR_EnableBkUpAccess();
|
||||
|
||||
if (rtc_isenabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
#if !RTC_LSI /* => LSE */
|
||||
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSE;
|
||||
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE; // Mandatory, otherwise the PLL is reconfigured!
|
||||
|
|
@ -76,12 +81,7 @@ void rtc_init(void)
|
|||
error("PeriphClkInitStruct RTC failed with LSE\n");
|
||||
}
|
||||
|
||||
if (rtc_isenabled()) return;
|
||||
#else /* => RTC_LSI */
|
||||
if (rtc_isenabled()) return;
|
||||
|
||||
__HAL_RCC_PWR_CLK_ENABLE();
|
||||
|
||||
// Reset Backup domain
|
||||
__HAL_RCC_BACKUPRESET_FORCE();
|
||||
__HAL_RCC_BACKUPRESET_RELEASE();
|
||||
|
|
|
|||
Loading…
Reference in New Issue