[riot-notifications] [RIOT-OS/RIOT] Timer gets disabled after interrupt (#11526)

Alexander notifications at github.com
Wed May 15 09:24:09 CEST 2019


> > I am not sure, if this is a bug, or intentional feature, but on timer interrupt the bellow line would disable any future interrupts
> 
> That is intentional. The file is part of the periph/timer implementation, which allows only one active timer at a time (it is a slim abstraction of hardware timers).
> 
> The corresponding `timer_set_absolute()` enables the interrupt, e.g. here:
> 
> https://github.com/RIOT-OS/RIOT/blob/e4bc5d4718558ad308625b30841ee523dc136042/cpu/samd21/periph/timer.c#L147
> 
> If the timer enable flag wouldn't be disabled, the same callback would be re-executed every time the timer has overflowed and counted back up to the compare value.

Wouldn't the correct approach for doing that include enabling one-shop operation?

![image](https://user-images.githubusercontent.com/29629421/57756213-12707080-76f3-11e9-9078-44e19c4725a2.png)


-- 
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/issues/11526#issuecomment-492536621
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190515/f14849a5/attachment-0001.html>


More information about the notifications mailing list