Other Parts Discussed in Thread: SYSBIOS
Tool/software: TI C/C++ Compiler
Timer_Params timerParams; Timer_Params_init(&timerParams); timerParams.periodType = Timer_PeriodType_MICROSECS; // Period in uSec (default) timerParams.runMode = Timer_RunMode_CONTINUOUS; // Continuous Run (default) timerParams.startMode = Timer_StartMode_AUTO; // Auto Start timerParams.period = 1000; // 1000 uSecs = 1ms Timer_construct(&LED_timer0Struct, Timer_ANY, (Timer_FuncPtr)RFD_LED_TimerFxn, &timerParams, NULL);
----------------------------------------------------------------------------------------------------------------------------
In the context table, I'm correct to classified above as TASK and therefore safe to post semp in timer event function?
I getting missed semp execution every 1mSec because the binary count is 1. How to isolate why the binary count is stuck 1 and does not goes to 0 when it loop back to pend. Should I use reset before post?
Even with timeout set to 10 in semp post below, it did not work, am I missing something?
----------------------------------------------------------------------------------------------------------------------------
void RFD_Sem_Task_System(UArg arg0, UArg arg1) { while (1) { Semaphore_pend(RFD_System_sem_handle, 10); // Every 1mSec Event via RFD_LED.c/h 1mSec timer. Also 10mSec to ensure it reset to 0. if (zSTCFlag.AppState != eAPP_STANDBY) //-------------Application Manager { RFD_System_AppState(); } if (zSTCFlag.DebugState != eDBG_STANDBY) //-------------Debug Manager (Test Mode) { RFD_System_DebugState(); } if (zSTCFlag.RCVState != eRCV_STANDBY) //-------------ADC24 and RCV Manager, { RFD_System_RCVState(); } // if (SysTick1Sec==1) // { // } } }
----------------------------------------------------------------------------------------------------------------------------
Void RFD_LED_TimerFxn(UArg arg) { ...... ......LED seq function code (no HWI/SWI call/post from here). ...... Semaphore_post(RFD_System_sem_handle); }