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.

CC1310定时器在循环中应用问题

Other Parts Discussed in Thread: CC1310

Hi,

    目前通过GPTimer配置好定时器,使得程序在一定周期内进入中断函数中。由于在程序运行中会有更改周期的需求,因此考虑把定时器配置函数放入到循环中。当在循环中运行时,发现定时器GPTimerCC26XX_open后返回NULL

    GPTimerCC26XX_Params paramsTimer1A;

    GPTimerCC26XX_Params_init(&paramsTimer1A);
    paramsTimer1A.width          = GPT_CONFIG_32BIT;
    paramsTimer1A.mode           = GPT_MODE_PERIODIC_UP;
    paramsTimer1A.debugStallMode = GPTimerCC26XX_DEBUG_STALL_OFF;
    hTimer1A = GPTimerCC26XX_open(CC1310_LAUNCHXL_GPTIMER1A, &paramsTimer1A);
    if(hTimer1A == NULL) 
    {
       while(1);
    }

也无法进行周期修改,请问定时器配置函数不能在循环中应用吗?

想在主程序运行过程中进行修改定时器周期值,如果不在循环中,该怎么样实现呢?

谢谢!