[riot-notifications] [RIOT] kinetis: timer or xtimer is broken [bisected] (#3941)

Kaspar Schleiser notifications at github.com
Thu Sep 24 10:57:44 CEST 2015


> does your solution for the itron with two periph/timer devices need any modifications to xtimer or is it simply configuration?

No, it doesn't need xtimer changes.

The itron timers seem to be very similar to the kinetis ones, they can downcount from a specific value, generating an interrupt when they arrive at zero and resetting to their initially set value. Also, the semantics when re-setting timers seem similar (like, writing a new start value will be effective after the the timer re-reads it when reaching zero, so timers need to be deactivated first on re-set).

I just use the first timer set to down-count from 0xffffffff, with an empty ISR. When any of the timers want to read out the current value, I return the first timers value (actually, 0-value to make it upcounting).

Now with the other timer channels, when setting a relative value, I set that value and let it count to 0. for absolute sets, I set it to "absolute_value-first_timer_now".

That way, I lose one timer channel, but the code doesn't have to do any complex arithmetic and doesn't ever loose ticks.

This is all at periph/timer level, so that interfaces exposes n-1 timers.

---
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/issues/3941#issuecomment-142861654
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20150924/6258357e/attachment.html>


More information about the notifications mailing list