Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem


Loading

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.


[ Back to the top ]    [ About FreeRTOS ]    [ Privacy ]    [ Sitemap ]    [ ]


Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

Meet Richard Barry and learn about running FreeRTOS on RISC-V at FOSDEM 2019

Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


Careers

FreeRTOS and other embedded software careers at AWS.



FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Renesas

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS

Xilinx Microblaze and Zynq partner