[riot-notifications] [RIOT-OS/RIOT] sam0_common: make RTT implementation common across all sam0 MCUs (#11318)

benpicco notifications at github.com
Wed May 8 18:43:33 CEST 2019


benpicco commented on this pull request.



>  
-    /* enable */
-    RTC->MODE0.CTRLA.bit.ENABLE = 1;
-    while(RTC->MODE0.SYNCBUSY.bit.ENABLE) {}
+void rtt_init(void)
+{
+    _rtt_clock_setup();
+    rtt_poweron();
+
+    /* set 32bit counting mode */
+#ifdef REG_RTC_MODE0_CTRLA
+    RTC->MODE0.CTRLA.reg = 0;

Actually since both just write the CTRLA register, could we not just do `RTC->MODE0.CTRLA.reg = RTC_MODE0_CTRLA_ENABLE;` in one go?

-- 
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/11318#discussion_r282152142
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190508/c98dda35/attachment.html>


More information about the notifications mailing list