[riot-devel] [RIOT][xTimer] Question about xtimer implementation.

Kaspar Schleiser kaspar at schleiser.de
Mon Apr 3 08:58:04 CEST 2017


Hi Phuong,

On 04/01/2017 04:40 PM, Minh Phuong Dang wrote:
> The CPU has 32bit timers/counters and it has countdown mode only. When
> the timer reaches zero it generates timer interrupt request to the CPU.
> I reference to another platforms porting which are implemented count up
> timer mode only.

I usually just substract the every actual timer value from e.g.,
"0xffffffff". That way the value just gets interpreted as "counting up".

> I do not really understand how does xtimer module work, would you please
> show me how to implement for countdown timer case ?

This needs to be done in your board's periph/timer implementation, thus
it should be independent from xtimer.

Hope this helps!
Kaspar





More information about the devel mailing list