[riot-notifications] [RIOT-OS/RIOT] RTC for stm32f1 (#11258)

Former notifications at github.com
Wed Mar 27 10:40:20 CET 2019


Former commented on this pull request.



> @@ -322,4 +329,257 @@ void ISR_NAME(void)
     cortexm_isr_end();
 }
 
+#elif defined(CPU_FAM_STM32F1)
+
+void rtc_init(void)
+{
+    DEBUG("[RTC rtc_init]\n");
+
+    // Enable APB1 clocks
+    RCC->APB1ENR |= RCC_APB1ENR_PWREN | RCC_APB1ENR_BKPEN;
+
+    // Disable backup domain write protection
+    PWR->CR |= PWR_CR_DBP;
+
+    if ((RCC->BDCR & RCC_BDCR_RTCEN) != RCC_BDCR_RTCEN) // if RTC clock disabled

After config RTC drop current time.
Now rtc_init save current time. Config run always.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/11258#discussion_r269473791
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190327/22f88459/attachment.html>


More information about the notifications mailing list