[riot-notifications] [RIOT-OS/RIOT] sam0: Implement watchdog driver (#11520)

benpicco notifications at github.com
Fri Sep 20 18:43:25 CEST 2019


benpicco commented on this pull request.



> +    const uint32_t cycles = (ms * WDT_CLOCK_HZ) / 1024;
+
+    /* Minimum WDT period is 8 clock cycles (register value 0) */
+    if (cycles <= 8) {
+        return 0;
+    }
+
+    /* Round up to next pow2 and calculate the register value */
+    return 29 - __builtin_clz(cycles - 1);
+}
+
+#ifdef CPU_SAMD21
+static void _wdt_clock_setup(void)
+{
+/* RTC / RTT will alredy set up GCLK2 as needed */
+#if !defined(USEMODULE_PERIPH_RTC) && !defined(USEMODULE_PERIPH_RTT)

Thank you, good catch!

-- 
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/11520#discussion_r326713187
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190920/7118165e/attachment.htm>


More information about the notifications mailing list