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

Kaspar Schleiser notifications at github.com
Tue Apr 9 09:50:36 CEST 2019


kaspar030 commented on this pull request.



> +static time_t _rtc_get_time(void)
+{
+    return (RTC->CNTH << 16) | RTC->CNTL;
+}
+
+static void _rtc_set_time(time_t counter_val)
+{
+    _rtc_enter_config_mode();
+    RTC->CNTH = (counter_val & 0xffff0000) >> 16;
+    RTC->CNTL = counter_val & 0x0000ffff;
+    _rtc_exit_config_mode();
+}
+
+void rtc_init(void)
+{
+    /* save current time if RTC already works */

Wakeup from standby would be a reason.

-- 
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_r273364446
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190409/9bc3e224/attachment.html>


More information about the notifications mailing list