Hi,
I am using a GPT timer in CC2640R2F in conjunction with RTOS driver GPTimerCC26XX to create semaphores after a certain delay time.I am using the GPT_MODE_ONESHOT_UP offered by the driver.There are events where I need to stop the timer before it reaches the match value in order to avoid the semaphore. In the cases when I stopped the timer and I want to engage the timer again by setting a new match value and start the timer again I realize that the counter value of the timer is still at the point when I stopped the timer. Therefore I am looking for a way to set the counter value of the timer to zero. There is no function in the RTOS driver and I did not find a proper command in the driverlib.
How can a get the counter value to zero after stopping it by the driver function GPTimerCC26XX_stop?
The commands I am using is:
// ****** Initialization
GPTimerCC26XX_Handle SCB_Timer;
GPTimerCC26XX_Params params;
GPTimerCC26XX_Params_init(¶ms);
params.width = GPT_CONFIG_16BIT;
params.mode = GPT_MODE_ONESHOT_UP;
params.debugStallMode = GPTimerCC26XX_DEBUG_STALL_OFF;
SCB_Timer = GPTimerCC26XX_open(SCN_SCBTimer_Id, ¶ms);
if (!SCB_Timer) {
Report_System_Message(SYSTEM_MESSAGE_SCBTIMER_OPEN_FAIL);
Task_exit();
}
GPTimerCC26XX_registerInterrupt(SCB_Timer, SCB_TimerINT_SendSemaphoreAfterDelay, GPT_INT_TIMEOUT);
// ........the timer is used then in a lot of stages in a state machine to create the delayed semaphore by the following inline function
inline void SCB_SetTimerIntForDelayedFunctionCall(UInt32 Delaytime)
{
GPTimerCC26XX_setLoadValue(SCB_Timer, Delaytime);
GPTimerCC26XX_start(SCB_Timer);
}
Thanks in advance and best regards
Berthold