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.

Bug in function Timer_setFunc()

Hello,

I think I found a bug in Timer_setFunc(). It's present both in TI RTOS 2.01.00.03 and older v1.21.00.09 This function is implemented as follows

Void Timer_setFunc(Timer_Object *obj, Timer_FuncPtr fxn, UArg arg)
{
    obj->tickFxn = fxn;
    obj->arg = arg;

    Hwi_setFunc(obj->hwi, fxn, arg);
}

I removed Hwi_setFunc() call, because in my opinion "fxn" is not intended to be a Timer's Hwi handler directly.

  • Hi,

    This is not a bug, when a Timer is created a Hwi for the timer is also created and the tickFxn is used as the Hwi ISR. Thus, when the Timer expires/reaches period value, the tickFxn executes. The Timer_setFunc API allows you to change that function without closing and reopening the Timer.

    Regards,

    -- Emmanuel