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.

CC2642R: 关于cc2642使用tirtos定时器不准的问题求解

Part Number: CC2642R
Other Parts Discussed in Thread: SIMPLELINK-CC13XX-CC26XX-SDK

一,定时器初始化代码如下

  Timer_Params_init(&timeSleep_params);
  timeSleep_params.period = WAKEUP_TIMES * 1000 * 1000;  //
  timeSleep_params.periodUnits = Timer_PERIOD_US;
  timeSleep_params.timerMode = Timer_CONTINUOUS_CALLBACK;
  timeSleep_params.timerCallback = timerCallback;

  timerSleep = Timer_open(CONFIG_TIMER_0, &timeSleep_params);
  if (timerSleep == NULL)
  {
      /* Failed to initialized timer */
      while (1) {}
  }
  MyWakeUpT_CB.whichStandby = 0x21;
  if (Timer_start(timerSleep) == Timer_STATUS_ERROR)
  {
        /* Failed to start timer */
        while (1) {}
  }
二,定时器回调函数如下
void timerCallback(Timer_Handle myHandle, int_fast16_t status)
    if (myHandle == timerSleep)
    {
        //do some things
        Timer_stop(timerSleep);
    }
}
三,更改定时时间
Timer_stop(timerSleep);
Timer_setPeriod(timerSleep, Timer_PERIOD_US, time);
Timer_start(timerSleep);
四,现象
多次操作后会出现到达预定时间不进入定时器中断现象.