Hello,
I´m trying to use the Event_pend() function as a timer-watchdog so everytime my Receive_Task successes to receive data, it posts an event RXTIMEOUT which tells my Timeout_Task that reception is working properly. The idea is that if something happens and my Receive_Task stops posting the event within an interval of 100ms, then the Timeout_Task resets the reception buffer.
It sounds clear to me but unfortunatelly it´s not working. What am I doing wrong?
Info: SYS/BIOS 6.40.01.15, TI-RTOS 2.1.0.03, Clock.tickPeriod = 1000 us;
Thanks!
USBCDC_handleDataReceived (uint8_t intfNum)() //USB-API { semaphore_post(sem1) //Every time data is received sem1 is posted }
//priority = 3 Task_Receive() { semaphore_pend(sem1); ReceiveData(Buffer); ProcessData(Buffer); Event_post(RXTIMEOUT); SendData(ResponseBuffer); } Task_Timeout() //priority = 5 { timeout = 100; if(Event_pend(RXTIMEOUT, timeout) == 0) ResetBuffer(Buffer); }