[riot-notifications] [RIOT-OS/RIOT] cpu: RTC implementation for STM32F1 (#11258)

Former notifications at github.com
Wed Apr 10 13:57:12 CEST 2019


Former commented on this pull request.



> +}
+
+int rtc_set_alarm(struct tm *time, rtc_alarm_cb_t cb, void *arg)
+{
+    /* enable global RTC interrupt */
+    if (cb && !NVIC_GetEnableIRQ(RTC_IRQn)) {
+        NVIC_EnableIRQ(RTC_IRQn);
+        DEBUG("%s enable RTC IRQ\n", __func__);
+    }
+
+    /* save callback and argument */
+    isr_ctx.cb = cb;
+    isr_ctx.arg = arg;
+
+    /* set wakeup time */
+    time_t timestamp = mktime(time);

> AFAIK the stm32 have backup memory which is part of the RTC peripheral. Still this shouldn't be accessed through th ertc API, as @maribu stated.

STM32f103 do not have EEPROM and RTC->BKP0R. Use `rtc_set_alarm()` is not good hack, but this may be one of the last chances.

-- 
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_r273920637
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190410/2ace5650/attachment.html>


More information about the notifications mailing list