Skip to content

Commit

Permalink
Merge branch 'docs/freertos_stack_size_v5.3' into 'release/v5.3'
Browse files Browse the repository at this point in the history
docs(freertos): update freertos comments to reflect that stack size is in bytes (v5.3)

See merge request espressif/esp-idf!33504
  • Loading branch information
ESP-Marius committed Oct 10, 2024
2 parents 0ccbe0d + 6c83155 commit 4a74ca2
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,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.
Expand Down Expand Up @@ -565,7 +565,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.
Expand Down Expand Up @@ -659,7 +659,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.
Expand Down Expand Up @@ -2372,7 +2372,7 @@ char * pcTaskGetName( TaskHandle_t xTaskToQuery ) PRIVILEGED_FUNCTION;
*
* WARN: This function assumes that the pcWriteBuffer is of length
* configSTATS_BUFFER_MAX_LENGTH. This function is there only for
* backward compatiblity. New applications are recommended to use
* backward compatibility. New applications are recommended to use
* vTaskGetRunTimeStatistics and supply the length of the pcWriteBuffer
* explicitly.
*
Expand Down
6 changes: 3 additions & 3 deletions components/freertos/FreeRTOS-Kernel-SMP/portable/linux/port.c
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ BaseType_t xPortSetInterruptMask( void )

void vPortClearInterruptMask( BaseType_t xMask )
{
// Only reenable interrupts if xMask is 0
// Only re-enable interrupts if xMask is 0
uxInterruptLevel = xMask;
if (uxInterruptLevel == 0 && uxCriticalNestingIDF == 0) {
vPortEnableInterrupts();
Expand Down Expand Up @@ -720,7 +720,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
Expand Down Expand Up @@ -748,7 +748,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
Expand Down
15 changes: 7 additions & 8 deletions components/freertos/FreeRTOS-Kernel/include/freertos/task.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions components/freertos/FreeRTOS-Kernel/portable/linux/port_idf.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ static void main_task(void* args)

int main(int argc, const char **argv)
{
// This makes sure that stdio is always syncronized so that idf.py monitor
// This makes sure that stdio is always synchronized so that idf.py monitor
// and other tools read text output on time.
setvbuf(stdout, NULL, _IONBF, 0);

Expand Down Expand Up @@ -118,7 +118,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
Expand Down Expand Up @@ -146,7 +146,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
Expand Down

0 comments on commit 4a74ca2

Please sign in to comment.