rtel wrote on Thursday, November 19, 2009:
This is a topic that comes up here from time to time (as does ‘timers’, which is more appropriate for tick hooks).
There are two problems with talking about ‘events’:
- First there is no universal definition of what an ‘event’ is. People normally talk at cross purposes. People from a uCOS background will talk about events in the way uCOS does, but others will mean something completely different. For example, when porting a TCP/IP stack to FreeRTOS I was told it was impossible because FreeRTOS didn’t support ‘events’, but I found during the exercise that they thought an event was simple a way of one task signalling another, or an interrupt signalling a task. All that was needed was a binary semaphore!
- The second problem is, if you do mean events in the same way uCOS does then I have never found an implementation that was suitably efficient for inclusion in FreeRTOS. Nowhere in FreeRTOS are linked lists walked while interrupts are disabled, or from within interrupts for that matter.
It would be great to have an elaborate bitwise event mechanism, but its not going to happen soon. If you want to have multiple tasks signal one task then you can use a queue with multiple writers and a single reader - then pass a structure on the queue to say where the message came from or what the data it contains represents.