Hi,
I am working on LAUNCHXL-CC1312R1 board and rfEasyLinkRx example.
Setup of the timer and the interrupt is;
GPTimerCC26XX_Params params; params.width = GPT_CONFIG_32BIT; params.mode = GPT_MODE_ONESHOT_UP; params.debugStallMode = GPTimerCC26XX_DEBUG_STALL_OFF; hTimer = GPTimerCC26XX_open(Board_GPTIMER0A, ¶ms); if(hTimer == NULL) { while(1); } /* Set Timeout value to 300ms */ rxTimeoutVal = (SysCtrlClockGet()*3UL)/10UL - 1UL; GPTimerCC26XX_setLoadValue(hTimer, rxTimeoutVal); /* Register the GPTimer interrupt */ GPTimerCC26XX_registerInterrupt(hTimer, rxTimeoutCb, GPT_INT_TIMEOUT);
Here is the code;
PIN_setOutputValue(pinHandle, Board_PIN_LED2,1); PIN_setOutputValue(pinHandle, Board_PIN_LED2,0); GPTimerCC26XX_setLoadValue(hTimer, rxTimeoutVal); GPTimerCC26XX_start(hTimer); delay(250000); //delay 250 ms GPTimerCC26XX_stop(hTimer); PIN_setOutputValue(pinHandle, Board_PIN_LED1,1); PIN_setOutputValue(pinHandle, Board_PIN_LED1,0); GPTimerCC26XX_setLoadValue(hTimer, rxTimeoutVal); GPTimerCC26XX_start(hTimer); while(1);
And here is the interrupt function;
void rxTimeoutCb(GPTimerCC26XX_Handle handle, GPTimerCC26XX_IntMask interruptMask) { /* Set the Timeout Flag */ rxTimeoutFlag = true; PIN_setOutputValue(pinHandle, Board_PIN_LED2,1); PIN_setOutputValue(pinHandle, Board_PIN_LED2,0); }
There is the led pins behaviour. Despite stopping the timer and reloading the value, timer goes 50 ms more and interrupt comes. After stopping and reloading value, what should I have to do for it to go 300ms and give interrupt? Thanks..