How do I find the task state?
Given a task handle, I need to find the state of a task; either Ready, Blocked, or Suspended. How do I do that? I don’t see a function for that.
How do I find the task state?
> Given a task handle, I need to find the state of a task; either Ready, Blocked, or Suspended.
> I don’t see a function for that.
FreeRTOS doesn’t provide such a function.
> How do I do that?
Keep tracking of what you’re programming. If the task is executed it is in ready/run state. If you call vTaskDelay() it switches to blocked state for number of ticks. If you call vTaskSuspend() the task is in state suspended.
How do I find the task state?
You could implement such a function but it would not be particularly quick. The list from which a task is referenced denotes the tasks state, and as references are bidirectional it is straightforward to find the list. Look at the function vTaskList() for some clues – this prints out information on each task, including the state of the task.
Regards.
How do I find the task state?
All of the lists are static. I can’t access them from outside of the tasks.c module. Is there a global way to access the lists?
How do I find the task state?
There is no global way of accessing the lists – that is intentional. You can add functions to tasks.c to access the lists.
Regards.