FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [March 2008 Threads] How do I find the task state?Posted by Ricky on March 4, 2008 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.
RE: How do I find the task state?Posted by Maxim on March 4, 2008 > 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.
RE: How do I find the task state?Posted by Richard on March 4, 2008 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.
RE: How do I find the task state?Posted by Ricky on March 4, 2008 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?
RE: How do I find the task state?Posted by Richard on March 4, 2008 There is no global way of accessing the lists - that is intentional. You can add functions to tasks.c to access the lists.
Regards.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|