This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

HOW to use the timer to generate a interrupter(Cycle variable)



i use the GPT0 to generate a interrupter:

void rx_sync(void)

{

uint32_t current_value =0;

current_value = GPTimerCC26XX_getFreeRunValue(h_RFS) & 0x0000FFFF;

switch(fsm_timer)

{
case 0:
current_value += 3000;                                                                                                    //next interrupter occur after 3000us
GPTimerCC26XX_setMatchValue(h_RFS, (0x2F0000 | (current_value & 0x0000FFFF)));
fsm_timer =1;               
break;


case 1:                  

current_value += 5000;                                                                                                    //next interrupter occur after 5000us
GPTimerCC26XX_setMatchValue(h_RFS, (0x2F0000 | (current_value & 0x0000FFFF)));
fsm_timer =2;
break;


case 2:

current_value += 2000                                                                                                    //next interrupter occur after 2000us
GPTimerCC26XX_setMatchValue(h_RFS, (0x2F0000 | (current_value & 0x0000FFFF)));
fsm_timer =3;
break;


case 3:

current_value += 1000                                                                                                   //next interrupter occur after 1000us
GPTimerCC26XX_setMatchValue(h_RFS, (0x2F0000 | (current_value & 0x0000FFFF)));
fsm_timer =0;
break;
default:break;
}

}
void SYNC_TIMER_callback()
{
rx_sync();
return;
}
void taskRFSFxn(UArg arg0, UArg arg1)
{

GPTimerCC26XX_Params rfsParams;
GPTimerCC26XX_Params_init(&rfsParams);

rfsParams.width = GPT_CONFIG_16BIT;
rfsParams.mode = GPT_MODE_PERIODIC_UP;
rfsParams.debugStallMode = GPTimerCC26XX_DEBUG_STALL_ON;
h_RFS = GPTimerCC26XX_open(RF_SYNC_TIMER, &rfsParams);

if(h_RFS == NULL)
{
while(1);//fail to open the Timer
}
GPTimerCC26XX_setLoadValue(h_RFS, 0x2FFFFF);
GPTimerCC26XX_registerInterrupt(h_RFS, (GPTimerCC26XX_HwiFxn)&SYNC_TIMER_callback,GPT_INT_MATCH);
GPTimerCC26XX_start(h_RFS);
while(1)
{
Task_sleep(BIOS_WAIT_FOREVER);
}

}

i  want  that when the interrupter occur, i want  the next interrupter will come after 3000us/5000us/2000us/1000us ,but result is error, How to do it in the right way?