We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 267f640 commit 002cb03Copy full SHA for 002cb03
cores/arduino/stm32/rtc.c
@@ -314,6 +314,19 @@ void RTC_init(hourFormat_t format, sourceClock_t source)
314
{
315
initFormat = format;
316
317
+ /* Enable Power Clock */
318
+ __HAL_RCC_PWR_CLK_ENABLE();
319
+
320
+#ifdef HAL_PWR_MODULE_ENABLED
321
+ /* Allow access to Backup domain */
322
+ HAL_PWR_EnableBkUpAccess();
323
+#endif
324
+ /* Reset RTC Domain */
325
+ if(source != LSE_CLOCK) {
326
+ __HAL_RCC_BACKUPRESET_FORCE();
327
+ __HAL_RCC_BACKUPRESET_RELEASE();
328
+ }
329
330
/* Init RTC clock */
331
RTC_initClock(source);
332
0 commit comments