Skip to content

Commit ec4b02b

Browse files
fix(freertos): Correct taskRESERVED_TASK_NAME_LENGTH macro definition
This commit updates the definition of taskRESERVED_TASK_NAME_LENGTH in tasks.c to fix an unreachable preprocessor condition. Signed-off-by: Sudeep Mohanty <[email protected]>
1 parent d10ee46 commit ec4b02b

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

tasks.c

+11-5
Original file line numberDiff line numberDiff line change
@@ -156,16 +156,22 @@
156156
#define configIDLE_TASK_NAME "IDLE"
157157
#endif
158158

159-
#if ( configNUMBER_OF_CORES > 1 )
160-
/* Reserve space for Core ID and null termination. */
159+
/* Reserve space for Core ID and null termination. */
160+
#if ( configNUMBER_OF_CORES > 9 )
161+
/* More than 9 cores require 2 characters for core ID and 1 for null termination. */
162+
#if ( configMAX_TASK_NAME_LEN < 3U )
163+
#error Minimum required task name length is 3. Please increase configMAX_TASK_NAME_LEN.
164+
#endif
165+
#define taskRESERVED_TASK_NAME_LENGTH 3U
166+
167+
#elif ( configNUMBER_OF_CORES > 1 )
168+
/* Multi-core systems with up to 9 cores require 1 character for core ID and 1 for null termination. */
161169
#if ( configMAX_TASK_NAME_LEN < 2U )
162170
#error Minimum required task name length is 2. Please increase configMAX_TASK_NAME_LEN.
163171
#endif
164172
#define taskRESERVED_TASK_NAME_LENGTH 2U
165173

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
174+
#else /* if ( configNUMBER_OF_CORES > 9 ) */
169175
/* Reserve space for null termination. */
170176
#if ( configMAX_TASK_NAME_LEN < 1U )
171177
#error Minimum required task name length is 1. Please increase configMAX_TASK_NAME_LEN.

0 commit comments

Comments
 (0)