Other Parts Discussed in Thread: AM3358,
Dear all,
I would like to use a timer to call a function periodically on an AM3358. When I do the following in runtime, it works like a charm:
Timer_Params timerParams; Error_Block eb; Error_init(&eb); Timer_Params_init(&timerParams); timerParams.period = p->pixelTime_us; timerParams.periodType = Timer_PeriodType_MICROSECS; timerParams.arg = (UArg)p; timerParams.startMode = Timer_StartMode_USER; timerParams.runMode = Timer_RunMode_CONTINUOUS; iterTimer = Timer_create(Timer_ANY, &doIteration_LaserRunTime, &timerParams, &eb); Timer_start(iterTimer);
Eventually, I want to create one global timer and use it to call different functions periodically. I Also want to reconfigure the period each time. Changing the period with the provided function works:
UInt key = Hwi_disable(); Timer_setPeriodMicroSecs(iterTimer, p->pixelTime_us + 5); // for example Hwi_restore(key);
But changing the function that is set as the hwi handler does not work. Even after doing the following, which should in fact not have any effect, starting the timer results is no response whatsoever:
Timer_setFunc(iterTimer, &doIteration_LaserRunTime, (UArg)p); // same same Timer_start(iterTimer); // (...) // nothing happens, function is never called // (...)
I'm getting the same behaviour with the hal timer header and when using the dmtimer header.
Am I doing something wrong? Are extra steps needed? I'm using sysbios version 6_50_00_10.
Looking forward to your replies
Fabian