tomwbarclay wrote on Monday, October 21, 2013:
fast forward to version 7.3. Same question, but slightly different issue.
I have a number of tasks that wait forever on an event. A number of them wait on the same event, but only one should be running (blocked waiting on the event) while the remainder are suspended (and should ignore the event).
I want to do this as a way of determining the behavior of the unit based on the unit mode variable. Each task does a different action when triggered by the same event.
At power up all of the tasks are created and enter the running state till they hit the wait forever on an event code line.
I manually force a task_suspend() on all the tasks, except the one that matches the desired behavior.
Point is that according to the previous comments, and I cant find any more up to date discussion, the suspended tasks will be ‘resumed’ if their matching trigger event occurs.
Assuming the above is true then it raises the fact that I cant use task_suspend() and task_resume() as a hard task on/off mechanism.
In my tests I can read a task state and find it is SUSPENDED rather than the BLOCKED state I expected.
If my reading of FreeRTOS behavior is correct then I will have to re-architect my code.
No problem … I’d just like to know.
Best regards …