Hi,
I'm porting the RIOT-RTOS to the tiva launchpad (ek-tm4c123gxl).
RIOT wants to have a timer always running so it can get a current time in ticks, but would also like to use that timer to trigger events at given times.
So I do
SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER0); TimerConfigure(TIMER0_BASE, TIMER_CFG_SPLIT_PAIR | TIMER_CFG_A_PERIODIC_UP | TIMER_CFG_B_PERIODIC_UP); TimerPrescaleSet(TIMER0_BASE, TIMER_A, TIMER_0_PRESCALER); TimerLoadSet(TIMER0_BASE, TIMER_A, 0xffff); NVIC_EnableIRQ(TIMER0A_IRQn); TimerEnable(TIMER0_BASE, TIMER_A);
to start a counting timer, which doesn't trigger any interrupts yet.
Now if the RTOS wants to trigger an event in 1000 ticks, I would do
uint32_t value = TimerValueGet(TIMER0_BASE, TIMER_A) + 1000; TimerMatchSet(TIMER0_BASE, TIMER_A, value); TimerIntEnable(TIMER0_BASE, TIMER_CAPA_MATCH);
However, nothing happens.
I think I misunderstood the way TimerMatchSet()/TIMER_CAPA_MATCH works, I assumed I would set a value at which an interrupt is triggered, but that doesn't seem to be the case.
How can I achieve this behaviour?
When I set TIMER_TIMA_TIMEOUT the interrupt is trigged on overflow as expected.