EasyManuals Logo

Espressif ESP32-S2 User Manual

Espressif ESP32-S2
1695 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #881 background imageLoading...
Page #881 background image
Chapter 2. API Reference
(continued from previous page)
// format the raw data as human readable ASCII data
for( x = 0; x < uxArraySize; x++ )
{
// What percentage of the total run time has the task used?
// This will always be rounded down to the nearest integer.
// ulTotalRunTimeDiv100 has already been divided by 100.
ulStatsAsPercentage = pxTaskStatusArray[ x ].ulRunTimeCounter
,/ ulTotalRunTime;
if( ulStatsAsPercentage > 0UL )
{
sprintf( pcWriteBuffer, "%s\t\t%lu\t\t%lu%%\r\n",
,pxTaskStatusArray[ x ].pcTaskName, pxTaskStatusArray[ x ].ulRunTimeCounter,
,ulStatsAsPercentage );
}
else
{
// If the percentage is zero here then the task has
// consumed less than 1% of the total run time.
sprintf( pcWriteBuffer, "%s\t\t%lu\t\t<1%%\r\n",
,pxTaskStatusArray[ x ].pcTaskName, pxTaskStatusArray[ x ].ulRunTimeCounter );
}
pcWriteBuffer += strlen( ( char * ) pcWriteBuffer );
}
}
// The array is no longer needed, free the memory it consumes.
vPortFree( pxTaskStatusArray );
}
}
Return The number of TaskStatus_t structures that were populated by uxTaskGetSystemState(). This should
equal the number returned by the uxTaskGetNumberOfTasks() API function, but will be zero if the value
passed in the uxArraySize parameter was too small.
Parameters
pxTaskStatusArray: A pointer to an array of TaskStatus_t structures. The array must contain
at least one TaskStatus_t structure for each task that is under the control of the RTOS. The number
of tasks under the control of the RTOS can be determined using the uxTaskGetNumberOfTasks()
API function.
uxArraySize: The size of the array pointed to by the pxTaskStatusArray parameter. The size is
specified as the number of indexes in the array, or the number of TaskStatus_t structures contained
in the array, not by the number of bytes in the array.
pulTotalRunTime: If configGENERATE_RUN_TIME_STATS is set to 1 in FreeRTOSCon-
g.h then *pulTotalRunTime is set by uxTaskGetSystemState() to the total run time (as defined by
the run time stats clock, see https://www.FreeRTOS.org/rtos-run-time-stats.html) since the target
booted. pulTotalRunTime can be set to NULL to omit the total run time information.
void vTaskList(char *pcWriteBuer)
List all the current tasks.
configUSE_TRACE_FACILITY and configUSE_STATS_FORMATTING_FUNCTIONS must both be de-
fined as 1 for this function to be available. See the configuration section of the FreeRTOS.org website for more
information.
NOTE 1: 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).
Espressif Systems 870
Submit Document Feedback
Release v4.4

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Espressif ESP32-S2 and is the answer not in the manual?

Espressif ESP32-S2 Specifications

General IconGeneral
BrandEspressif
ModelESP32-S2
CategorySingle board computers
LanguageEnglish