Other Parts Discussed in Thread: SYSBIOS
Hi,
I want to use oneshot gptimer interrupt.
Like, when timer reaches load count value, it goes to ISR and at the end of ISR, timer starts again.
Actually what I exactly try to do is that when gpio interrupt is occurred, timer is started,
But to make it simple exercise, i just set timer start in ISR,
Here is my code and it does not work anything. I've been searching in GPTimerCC26XX.h File Reference and still don't know.
So please give me advice about my code instead of that reference.
GPTimerCC26XX_Handle hTimer;
void timerCallback(GPTimerCC26XX_Handle handle, GPTimerCC26XX_IntMask interruptMask) {
// interrupt callback code goes here. Minimize processing in interrupt.
System_printf("timer\n");
System_flush();
GPTimerCC26XX_start(hTimer);
}
/*
* ======== mainThread ========
*/
void *mainThread(void *arg0)
{
GPTimerCC26XX_Params params;
GPTimerCC26XX_Params_init(¶ms);
params.width = GPT_CONFIG_16BIT;
params.mode = GPT_MODE_ONESHOT_UP ;
params.debugStallMode = GPTimerCC26XX_DEBUG_STALL_OFF;
hTimer = GPTimerCC26XX_open(Board_GPTIMER0A, ¶ms);
if(hTimer == NULL) {
System_printf("timer error\n");
System_flush();
while(1);
}
System_printf("timer start\n");
System_flush();
GPTimerCC26XX_setLoadValue(hTimer, 100);
GPTimerCC26XX_registerInterrupt(hTimer, timerCallback, GPT_INT_TIMEOUT);
GPTimerCC26XX_start(hTimer);
}