Tool/software: TI-RTOS
hello everyone, im am currently new on this field of microcontrollers, im trying to start a stoper (GPT_MODE_ONESHOT_UP mode) and then to reastart it in a loop with the function GPTimerCC26XX_close(hTimer),
the function suppoose the initilize the stoper time to zero , but its fail to do so. to stoper continue running after this function ( i have to problem to start it)
this is the code if someone maybe know the reason or can help me? thank you very much
void *mainThread(void *arg0)
{
/* 1 second delay */
uint32_t SLEEP = 2;
uint32_t Time = 1;
/* Call driver init functions */
GPIO_init();
GPIO_write(Board_GPIO_LED0, Board_GPIO_LED_ON);
GPTimerCC26XX_Handle hTimer;
sleep(SLEEP);
GPIO_toggle(Board_GPIO_LED0);
#define GPT_NUM_INTS 4
GPTimerCC26XX_Params params;
GPTimerCC26XX_Params_init(¶ms);
params.width = GPT_CONFIG_16BIT;
params.mode = ;
params.debugStallMode = GPTimerCC26XX_DEBUG_STALL_ON;
hTimer = GPTimerCC26XX_open(Board_GPTIMER0A , ¶ms );
GPTimerCC26XX_enableInterrupt(hTimer, GPT_INT_TIMEOUT);
while(1){
Time = 0;
GPTimerCC26XX_start(hTimer);
while(PIN_getInputValue(Board_DIO12) != 1){
}
Time = GPTimerCC26XX_getValue(hTimer);
// GPTimerCC26XX_stop(hTimer);
GPTimerCC26XX_close(hTimer);
hTimer = GPTimerCC26XX_open(Board_GPTIMER0A , ¶ms );
if(Time > 2000){
GPIO_toggle(Board_GPIO_LED0);
sleep(SLEEP);
}
}