[riot-notifications] [RIOT-OS/RIOT] tests/ztimer_periodic: iterate over clocks (#16254)

Marian Buschsieweke notifications at github.com
Tue Jun 1 15:45:24 CEST 2021


@maribu commented on this pull request.



>  
-    ztimer_periodic_init(ZTIMER_MSEC, &t, callback, NULL, INTERVAL);
-    uint32_t last = ztimer_now(ZTIMER_MSEC);
-
-    ztimer_periodic_start(&t);
-
-    if (!ztimer_is_set(ZTIMER_MSEC, &t.timer)) {
-        print_str("Test failed\n");
-        return 1;
-    }
+    for (size_t j = 0; j < ARRAY_SIZE(clocks); j++) {
+        printf("Testing clock: %s\n", _names[j]);
+        ztimer_clock_t *clock = clocks[j];
+        ztimer_periodic_init(clock, &t, callback, clock, _intervals[j]);
+        uint32_t last = ztimer_now(clock);

On the arduino-uno, the `ZTIMER_USEC` times are consistently bad, while on atmega256rfr2-xpro it works fine for all but the first timeout. I think both are running at 16 MHz, are using the same peripheral time and should have (almost) the same IPC, so I wonder what is causing the difference.

-- 
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/16254#discussion_r643117003
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210601/1fe61f7e/attachment.htm>


More information about the notifications mailing list