| Latest News Items: FAT file system released - Tick suppression demo'ed SAM4L MCU & RX100 MCUs - embTCP released for PIC32 |
|
|||||||||||||||||||||||||||||||||
Task Utilities
|
|||||||||||||||||||||||||||||||||
| xTask | The handle of the subject task (the task being queried). |
|
State
|
Returned Value
|
| Ready | eReady |
| Running | eRunning (the calling task is querying its own priority) |
| Blocked | eBlocked |
| Suspended | eSuspended |
| Deleted | eDeleted (the tasks TCB is waiting to be cleaned up) |
signed char * pcTaskGetTaskName( xTaskHandle xTaskToQuery );INCLUDE_pcTaskGetTaskName must be set to 1 in FreeRTOSConfig.h for pcTaskGetTaskName() to be available.
| xTaskToQuery | The handle of the task being queried. xTaskToQuery can be set to NULL to query the name of the calling task. |
volatile portTickType xTaskGetTickCount( void );
This function cannot be called from an ISR. Use xTaskGetTickCountFromISR() instead.
volatile portTickType xTaskGetTickCountFromISR( void );
A version of xTaskGetTickCount() that can be called from an ISR.
portBASE_TYPE xTaskGetSchedulerState( void );
unsigned portBASE_TYPE uxTaskGetNumberOfTasks( void );
void vTaskList( portCHAR *pcWriteBuffer );configUSE_TRACE_FACILITY must be defined as 1 for this function to be available. See the configuration section for more information.
NOTE: This function will disable interrupts for its duration. It is not intended for normal application runtime use but as a debug aid.
Lists all the current tasks, along with their current state and stack usage high water mark.
Tasks are reported as blocked ('B'), ready ('R'), deleted ('D') or suspended ('S').
| pcWriteBuffer | A buffer into which the above mentioned details will be written, in ascii form. This buffer is assumed to be large enough to contain the generated report. Approximately 40 bytes per task should be sufficient. |
void vTaskStartTrace( portCHAR * pcBuffer, unsigned portLONG ulBufferSize );[The function relates to the legacy trace utility - which was removed in FreeRTOS V7.1.0 - users may find the newer Trace Hook Macros easier and more powerful to use.]
Starts a RTOS kernel activity trace. The trace logs the identity of which task is running when.
The trace file is stored in binary format. A separate DOS utility called convtrce.exe is used to convert this into a tab delimited text file which can be viewed and plotted in a spread sheet.
| pcBuffer | The buffer into which the trace will be written. |
| ulBufferSize | The size of pcBuffer in bytes. The trace will continue until either the buffer in full, or ulTaskEndTrace() is called. |
unsigned portLONG ulTaskEndTrace( void );[The function relates to the legacy trace utility - which was removed in FreeRTOS V7.1.0 - users may find the newer Trace Hook Macros easier and more powerful to use.]
Stops an RTOS kernel activity trace. See vTaskStartTrace().
void vTaskGetRunTimeStats( portCHAR *pcWriteBuffer );See the Run Time Stats page for a full description of this feature.
configGENERATE_RUN_TIME_STATS must be defined as 1 for this function to be available. The application must also then provide definitions for portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() and portGET_RUN_TIME_COUNTER_VALUE to configure a peripheral timer/counter and return the timers current count value respectively. The counter should be at least 10 times the frequency of the tick count.
NOTE: This function will disable interrupts for its duration. It is not intended for normal application runtime use but as a debug aid.
Setting configGENERATE_RUN_TIME_STATS to 1 will result in a total accumulated execution time being stored for each task. The resolution of the accumulated time value depends on the frequency of the timer configured by the portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() macro. Calling vTaskGetRunTimeStats() writes the total execution time of each task into a buffer, both as an absolute count value and as a percentage of the total system execution time.
| pcWriteBuffer | A buffer into which the execution times will be written, in ascii form. This buffer is assumed to be large enough to contain the generated report. Approximately 40 bytes per task should be sufficient. |