fix(radio): improve initialisation of RTC (#6028)

This commit is contained in:
3djc
2025-03-29 11:42:37 +10:00
committed by GitHub
parent 6793b30fd8
commit b919c01819
@@ -80,6 +80,10 @@ void rtcInit()
__HAL_RCC_RTC_CONFIG(RCC_RTCCLKSOURCE_LSE);
}
#if defined(STM32H7)
__HAL_RCC_LSEDRIVE_CONFIG(RCC_LSEDRIVE_HIGH);
#endif
__HAL_RCC_RTC_ENABLE();
HAL_RTC_WaitForSynchro(&rtc);
@@ -93,6 +97,9 @@ void rtcInit()
rtc.Init.OutPutType = RTC_OUTPUT_TYPE_OPENDRAIN;
HAL_RTC_Init(&rtc);
HAL_PWR_EnableBkUpAccess();
HAL_RTC_WaitForSynchro(&rtc);
struct gtm utm;
rtcGetTime(&utm);
g_rtcTime = gmktime(&utm);