From 8af2c13b83410f0f850a1df8de777725f00341df Mon Sep 17 00:00:00 2001 From: Rick Date: Mon, 23 Dec 2024 14:37:28 +0800 Subject: [PATCH] Add title for each column in the table from vTaskListTasks The task table returned by vTaskListTasks is human readable. But it misses a description for each column. Add a title row for better human readability. --- tasks.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tasks.c b/tasks.c index f6af37bab..2d4c85848 100644 --- a/tasks.c +++ b/tasks.c @@ -141,7 +141,7 @@ #define tskREADY_CHAR ( 'R' ) #define tskDELETED_CHAR ( 'D' ) #define tskSUSPENDED_CHAR ( 'S' ) - +#define tskTITLE_STR "TaskName State Priority WaterMark TaskID" /* * Some kernel aware debuggers require the data the debugger needs access to be * global, rather than file scope. @@ -7312,6 +7312,18 @@ static void prvResetNextTaskUnblockTime( void ) /* Generate the (binary) data. */ uxArraySize = uxTaskGetSystemState( pxTaskStatusArray, uxArraySize, NULL ); + /* Create title for each column of task table */ + if (uxArraySize > 0) + { + iSnprintfReturnValue = snprintf(pcWriteBuffer, + uxBufferLength - uxConsumedBufferLength, + "%s\r\n", + tskTITLE_STR); + uxCharsWrittenBySnprintf = prvSnprintfReturnValueToCharsWritten(iSnprintfReturnValue, uxBufferLength - uxConsumedBufferLength); + uxConsumedBufferLength += uxCharsWrittenBySnprintf; + pcWriteBuffer += uxCharsWrittenBySnprintf; + } + /* Create a human readable table from the binary data. */ for( x = 0; x < uxArraySize; x++ ) {