[riot-notifications] [RIOT-OS/RIOT] periph/timer: add timer_set_periodic() (#13902)

benpicco notifications at github.com
Wed May 27 21:43:43 CEST 2020


@benpicco commented on this pull request.



> +
+    *succeeded = false;
+    return "ERROR";
+}
+
+int main(void)
+{
+    mutex_t lock = MUTEX_INIT_LOCKED;
+    const unsigned timer_hz = 62500;
+    const unsigned steps = (250UL * timer_hz) / 1000; /* 250 ms */
+
+    printf("\nRunning Timer %d at %u Hz.\n", TIMER_CYCL, timer_hz);
+    printf("One counter cycle is %u ticks or 250 ms\n", steps);
+    puts("Will print 'tick' every second / every 4 cycles.\n");
+
+    timer_init(TIMER_CYCL, timer_hz, cb, &lock);

Well, at least it serves as a compile-test for `atmega1281`.

-- 
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/13902#discussion_r431400055
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20200527/92106eb0/attachment.htm>


More information about the notifications mailing list