[riot-notifications] [RIOT-OS/RIOT] cpu/sam0_common: add rtc_get_tamper_event() (#16187)

Francisco notifications at github.com
Tue Apr 13 10:21:21 CEST 2021


@fjmolinas commented on this pull request.



> @@ -374,6 +384,26 @@ void rtc_tamper_enable(void)
     DEBUG("tamper enabled\n");
 }
 
+uint8_t rtc_get_tamper_event(void)
+{
+    uint32_t ret = RTC->MODE0.TAMPID.reg;
+
+    /* clear tamper event */
+    RTC->MODE0.INTFLAG.reg = RTC_MODE0_INTFLAG_TAMPER;
+    RTC->MODE0.TAMPID.reg  = ret;
+
+    return ret & 0x1F;

Why 0x1f?

-- 
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/16187#pullrequestreview-634303592
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210413/f9624a0d/attachment.htm>


More information about the notifications mailing list