Skip to content

Commit fbaeba3

Browse files
fix(freertos): Correct taskRESERVED_TASK_NAME_LENGTH macro definition (#1241)
This commit updates the definition of taskRESERVED_TASK_NAME_LENGTH in tasks.c to fix an unreachable preprocessor condition. Signed-off-by: Sudeep Mohanty <sudeep.mohanty@espressif.com> Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
1 parent a470b2d commit fbaeba3

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

tasks.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,16 +156,15 @@
156156
#define configIDLE_TASK_NAME "IDLE"
157157
#endif
158158

159+
/* Reserve space for Core ID and null termination. */
159160
#if ( configNUMBER_OF_CORES > 1 )
160-
/* Reserve space for Core ID and null termination. */
161+
/* Multi-core systems with up to 9 cores require 1 character for core ID and 1 for null termination. */
161162
#if ( configMAX_TASK_NAME_LEN < 2U )
162163
#error Minimum required task name length is 2. Please increase configMAX_TASK_NAME_LEN.
163164
#endif
164165
#define taskRESERVED_TASK_NAME_LENGTH 2U
165166

166-
#elif ( configNUMBER_OF_CORES > 9 )
167-
#warning Please increase taskRESERVED_TASK_NAME_LENGTH. 1 character is insufficient to store the core ID.
168-
#else
167+
#else /* if ( configNUMBER_OF_CORES > 1 ) */
169168
/* Reserve space for null termination. */
170169
#if ( configMAX_TASK_NAME_LEN < 1U )
171170
#error Minimum required task name length is 1. Please increase configMAX_TASK_NAME_LEN.
@@ -3597,7 +3596,12 @@ static BaseType_t prvCreateIdleTasks( void )
35973596
* only one idle task. */
35983597
#if ( configNUMBER_OF_CORES > 1 )
35993598
{
3600-
/* Append the idle task number to the end of the name. */
3599+
/* Append the idle task number to the end of the name.
3600+
*
3601+
* Note: Idle task name index only supports single-character
3602+
* core IDs (0-9). If the core ID exceeds 9, the idle task
3603+
* name will contain an incorrect ASCII character. This is
3604+
* acceptable as the task name is used mainly for debugging. */
36013605
cIdleName[ xIdleTaskNameIndex ] = ( char ) ( xCoreID + '0' );
36023606
cIdleName[ xIdleTaskNameIndex + 1 ] = '\0';
36033607
}

0 commit comments

Comments
 (0)