Notify

I have different task running under FreeRTOS. These tasks kind of work together, so to control the interaction I have made another task; a controller task. The problem I now have is that this controller task needs to wait for any of the other tasks to fire an event. When any of the other tasks fires an event the controller task needs to perform some action (so it needs to know which task fired the event). When I say fire an event I mean that the task needs to give a notification to another task. Can anyone point out a nice way to do this in FreeRTOS? Thank you in advance! Kind Regards, Teun

Notify

Can you use a queue? The controller task blocks on the queue.  When one of the other tasks ‘fires an event’ it simply posts a number on the queue that identifies the task.  The controller task will unblock when data becomes available on the queue, read the number, and perform take any action necessary.

Notify

Thanks for the advice! I was thinking in the same direction. The only thing I miss in this approach are priorities, but I guess thats not so bad. Ill implement it like this. Thanks again! Kind Regards, Teun