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.

CC2650DK HeartRate example timer expiration

Expert 1340 points


In the CC2650DK HeartRate example, the function HeartRate_measPerTask() is called upon periodic timer expiration. In this function Util_startClock(&measPerClock) is called, although the clock was never stopped in the first place. Why is this call needed? Or does the clock automatically stop upon expiration?

  • Hi Tosa,

    measPerClock is created in the following way:

     Util_constructClock(&measPerClock, HeartRate_clockHandler,
                         DEFAULT_HEARTRATE_PERIOD, 0, false,
                         HEARTRATE_MEAS_PERIODIC_EVT);
    

    Since the 4th parameter is 0, measPerClock is configured as an one-shot timer, not a periodic one. So it should be restarted every time.

    - Cetri