[riot-notifications] [RIOT-OS/RIOT] cpu/atmega_common: Fix periph_timer (#14098)

benpicco notifications at github.com
Thu May 28 13:35:42 CEST 2020

@benpicco commented on this pull request.

> +        /* Timer already expired. Trigger the interrupt now and loop until it
+         * is triggered.
+         */
+        while (!(*ctx[tim].flag & (1 << (OCF1A + channel)))) {
+            ctx[tim].dev->OCR[channel] = ctx[tim].dev->CNT;
+        }

Now I wonder: Is that really what we want?

The timer will wrap around, so when using the 'raw' `timer_set()` I'd expect it not to do anything clever but just to set the alarm. It would then be triggerd after the timer has overflowed.

Unfortunately the API is not very clear what should happen here.

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20200528/3da3dcfb/attachment.htm>

More information about the notifications mailing list