From 9bff8ad50e46d3e12991b68d212c4ac605b0fb99 Mon Sep 17 00:00:00 2001 From: Marius Vikhammer Date: Mon, 19 Aug 2024 16:45:19 +0800 Subject: [PATCH] docs(freertos): update freertos comments to reflect that stack size is in bytes Closes https://github.com/espressif/esp-idf/issues/11600 --- .../FreeRTOS-Kernel-SMP/include/freertos/task.h | 6 +++--- .../FreeRTOS-Kernel-SMP/portable/linux/port.c | 4 ++-- .../FreeRTOS-Kernel/include/freertos/task.h | 15 +++++++-------- .../FreeRTOS-Kernel/portable/linux/port_idf.c | 4 ++-- 4 files changed, 14 insertions(+), 15 deletions(-) diff --git a/components/freertos/FreeRTOS-Kernel-SMP/include/freertos/task.h b/components/freertos/FreeRTOS-Kernel-SMP/include/freertos/task.h index f00739fdd4..948e2e3c4c 100644 --- a/components/freertos/FreeRTOS-Kernel-SMP/include/freertos/task.h +++ b/components/freertos/FreeRTOS-Kernel-SMP/include/freertos/task.h @@ -494,7 +494,7 @@ typedef enum * xHandle = xTaskCreateStatic( * vTaskCode, // Function that implements the task. * "NAME", // Text name for the task. - * STACK_SIZE, // Stack size in words, not bytes. + * STACK_SIZE, // Stack size in bytes. * ( void * ) 1, // Parameter passed into the task. * tskIDLE_PRIORITY,// Priority at which the task is created. * xStack, // Array to use as the task's stack. @@ -566,7 +566,7 @@ typedef enum * { * vATask, // pvTaskCode - the function that implements the task. * "ATask", // pcName - just a text name for the task to assist debugging. - * 100, // uxStackDepth - the stack size DEFINED IN WORDS. + * 100, // uxStackDepth - the stack size DEFINED IN BYTES. * NULL, // pvParameters - passed into the task function as the function parameters. * ( 1U | portPRIVILEGE_BIT ),// uxPriority - task priority, set the portPRIVILEGE_BIT if the task should run in a privileged state. * cStackBuffer,// puxStackBuffer - the buffer to be used as the task stack. @@ -660,7 +660,7 @@ typedef enum * { * vATask, // pvTaskCode - the function that implements the task. * "ATask", // pcName - just a text name for the task to assist debugging. - * 100, // uxStackDepth - the stack size DEFINED IN WORDS. + * 100, // uxStackDepth - the stack size DEFINED IN BYTES. * NULL, // pvParameters - passed into the task function as the function parameters. * ( 1U | portPRIVILEGE_BIT ),// uxPriority - task priority, set the portPRIVILEGE_BIT if the task should run in a privileged state. * cStackBuffer,// puxStackBuffer - the buffer to be used as the task stack. diff --git a/components/freertos/FreeRTOS-Kernel-SMP/portable/linux/port.c b/components/freertos/FreeRTOS-Kernel-SMP/portable/linux/port.c index 78a73f1e28..569349f46b 100644 --- a/components/freertos/FreeRTOS-Kernel-SMP/portable/linux/port.c +++ b/components/freertos/FreeRTOS-Kernel-SMP/portable/linux/port.c @@ -712,7 +712,7 @@ void vApplicationGetIdleTaskMemory( StaticTask_t ** ppxIdleTaskTCBBuffer, /* Pass out the size of the array pointed to by *ppxIdleTaskStackBuffer. * Note that, as the array is necessarily of type StackType_t, - * configMINIMAL_STACK_SIZE is specified in words, not bytes. */ + * configMINIMAL_STACK_SIZE is specified in bytes. */ *pulIdleTaskStackSize = configMINIMAL_STACK_SIZE; } #endif // configSUPPORT_STATIC_ALLOCATION == 1 @@ -749,7 +749,7 @@ void vApplicationGetTimerTaskMemory( StaticTask_t ** ppxTimerTaskTCBBuffer, /* Pass out the size of the array pointed to by *ppxTimerTaskStackBuffer. * Note that, as the array is necessarily of type StackType_t, - * configMINIMAL_STACK_SIZE is specified in words, not bytes. */ + * configMINIMAL_STACK_SIZE is specified in bytes. */ *pulTimerTaskStackSize = configTIMER_TASK_STACK_DEPTH; } #endif // configSUPPORT_STATIC_ALLOCATION == 1 && (configUSE_TIMERS == 1) diff --git a/components/freertos/FreeRTOS-Kernel/include/freertos/task.h b/components/freertos/FreeRTOS-Kernel/include/freertos/task.h index 976894ee6b..a2bf05e248 100644 --- a/components/freertos/FreeRTOS-Kernel/include/freertos/task.h +++ b/components/freertos/FreeRTOS-Kernel/include/freertos/task.h @@ -6,7 +6,7 @@ * * SPDX-License-Identifier: MIT * - * SPDX-FileContributor: 2023 Espressif Systems (Shanghai) CO LTD + * SPDX-FileContributor: 2023-2024 Espressif Systems (Shanghai) CO LTD * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in @@ -452,10 +452,9 @@ typedef enum * Example usage: * @code{c} * - * // Dimensions of the buffer that the task being created will use as its stack. - * // NOTE: This is the number of words the stack will hold, not the number of - * // bytes. For example, if each stack item is 32-bits, and this is set to 100, - * // then 400 bytes (100 * 32-bits) will be allocated. + * // Dimensions the buffer that the task being created will use as its stack. + * // NOTE: This is the number of bytes the stack will hold, not the number of + * // words as found in vanilla FreeRTOS. #define STACK_SIZE 200 * * // Structure that will hold the TCB of the task being created. @@ -488,7 +487,7 @@ typedef enum * xHandle = xTaskCreateStatic( * vTaskCode, // Function that implements the task. * "NAME", // Text name for the task. - * STACK_SIZE, // Stack size in words, not bytes. + * STACK_SIZE, // Stack size in bytes. * ( void * ) 1, // Parameter passed into the task. * tskIDLE_PRIORITY,// Priority at which the task is created. * xStack, // Array to use as the task's stack. @@ -574,7 +573,7 @@ typedef enum * { * vATask, // pvTaskCode - the function that implements the task. * "ATask", // pcName - just a text name for the task to assist debugging. - * 100, // usStackDepth - the stack size DEFINED IN WORDS. + * 100, // usStackDepth - the stack size DEFINED IN BYTES. * NULL, // pvParameters - passed into the task function as the function parameters. * ( 1UL | portPRIVILEGE_BIT ),// uxPriority - task priority, set the portPRIVILEGE_BIT if the task should run in a privileged state. * cStackBuffer,// puxStackBuffer - the buffer to be used as the task stack. @@ -657,7 +656,7 @@ typedef enum * { * vATask, // pvTaskCode - the function that implements the task. * "ATask", // pcName - just a text name for the task to assist debugging. - * 100, // usStackDepth - the stack size DEFINED IN WORDS. + * 100, // usStackDepth - the stack size DEFINED IN BYTES. * NULL, // pvParameters - passed into the task function as the function parameters. * ( 1UL | portPRIVILEGE_BIT ),// uxPriority - task priority, set the portPRIVILEGE_BIT if the task should run in a privileged state. * cStackBuffer,// puxStackBuffer - the buffer to be used as the task stack. diff --git a/components/freertos/FreeRTOS-Kernel/portable/linux/port_idf.c b/components/freertos/FreeRTOS-Kernel/portable/linux/port_idf.c index 2d71e9a73f..98db411470 100644 --- a/components/freertos/FreeRTOS-Kernel/portable/linux/port_idf.c +++ b/components/freertos/FreeRTOS-Kernel/portable/linux/port_idf.c @@ -189,7 +189,7 @@ void vApplicationGetIdleTaskMemory( StaticTask_t ** ppxIdleTaskTCBBuffer, /* Pass out the size of the array pointed to by *ppxIdleTaskStackBuffer. * Note that, as the array is necessarily of type StackType_t, - * configMINIMAL_STACK_SIZE is specified in words, not bytes. */ + * configMINIMAL_STACK_SIZE is specified in bytes. */ *pulIdleTaskStackSize = configMINIMAL_STACK_SIZE; } #endif // configSUPPORT_STATIC_ALLOCATION == 1 @@ -225,7 +225,7 @@ void vApplicationGetTimerTaskMemory( StaticTask_t ** ppxTimerTaskTCBBuffer, /* Pass out the size of the array pointed to by *ppxTimerTaskStackBuffer. * Note that, as the array is necessarily of type StackType_t, - * configMINIMAL_STACK_SIZE is specified in words, not bytes. */ + * configMINIMAL_STACK_SIZE is specified in bytes. */ *pulTimerTaskStackSize = configTIMER_TASK_STACK_DEPTH; } #endif // (configSUPPORT_STATIC_ALLOCATION == 1) && (configUSE_TIMERS == 1)