The Tick_Task

davedoors wrote on Friday, April 24, 2009:

I cannot really read the code because of the crappy formatting in this forum, but take a look at the uIP examples. These block on a semaphore with a timeout. If an Ethernet event occurs it unblocks the task using the semaphore. Timers expiring are implemented simply by allowing the block time to expire and so causing the task to unblock.

An alternative would be to use a tick hook to implement a time, with the tick hook giving the semaphore to unblock the task each time the timer expired. The same semaphore can be used to handle both Ethernet and timer events.