void vAFunction( void ) { TaskHandle_t xHandle; TaskStatus_t xTaskDetails; /* Obtain the handle of a task from its name. */ xHandle = xTaskGetHandle( "Task_Name" ); /* Check the handle is not NULL. */ configASSERT( xHandle ); /* Use the handle to obtain further information about the task. */ vTaskGetInfo( /* The handle of the task being queried. */ xHandle, /* The TaskStatus_t structure to complete with information on xTask. */ &xTaskDetails, /* Include the stack high water mark value in the TaskStatus_t structure. */ pdTRUE, /* Include the task state in the TaskStatus_t structure. */ eInvalid ); }
The TaskStatus_t definitiontypedef struct xTASK_STATUS { /* The handle of the task to which the rest of the information in the structure relates. */ TaskHandle_t xHandle; /* A pointer to the task's name. This value will be invalid if the task was deleted since the structure was populated! */ const signed char *pcTaskName; /* A number unique to the task. */ UBaseType_t xTaskNumber; /* The state in which the task existed when the structure was populated. */ eTaskState eCurrentState; /* The priority at which the task was running (may be inherited) when the structure was populated. */ UBaseType_t uxCurrentPriority; /* The priority to which the task will return if the task's current priority has been inherited to avoid unbounded priority inversion when obtaining a mutex. Only valid if configUSE_MUTEXES is defined as 1 in FreeRTOSConfig.h. */ UBaseType_t uxBasePriority; /* The total run time allocated to the task so far, as defined by the run time stats clock. Only valid when configGENERATE_RUN_TIME_STATS is defined as 1 in FreeRTOSConfig.h. */ unsigned long ulRunTimeCounter; /* Points to the lowest address of the task's stack area. */ StackType_t *pxStackBase; /* The minimum amount of stack space that has remained for the task since the task was created. The closer this value is to zero the closer the task has come to overflowing its stack. */ unsigned short usStackHighWaterMark; } TaskStatus_t;
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
|