Chapter 2. API Reference
TaskHookFunction_t xTaskGetApplicationTaskTagFromISR(TaskHandle_t xTask)
Returns the pxHookFunction value assigned to the task xTask. Can be called from an interrupt service routine.
void vTaskSetThreadLocalStoragePointer(TaskHandle_t xTaskToSet, BaseType_t xIndex, void
*pvValue)
Set local storage pointer specific to the given task.
Each task contains an array of pointers that is dimensioned by the con-
figNUM_THREAD_LOCAL_STORAGE_POINTERS setting in FreeRTOSConfig.h. The kernel does
not use the pointers itself, so the application writer can use the pointers for any purpose they wish.
Parameters
• xTaskToSet: Task to set thread local storage pointer for
• xIndex: The index of the pointer to set, from 0 to con-
figNUM_THREAD_LOCAL_STORAGE_POINTERS - 1.
• pvValue: Pointer value to set.
void *pvTaskGetThreadLocalStoragePointer(TaskHandle_t xTaskToQuery, BaseType_t xIn-
dex)
Get local storage pointer specific to the given task.
Each task contains an array of pointers that is dimensioned by the con-
figNUM_THREAD_LOCAL_STORAGE_POINTERS setting in FreeRTOSConfig.h. The kernel does
not use the pointers itself, so the application writer can use the pointers for any purpose they wish.
Return Pointer value
Parameters
• xTaskToQuery: Task to get thread local storage pointer for
• xIndex: The index of the pointer to get, from 0 to con-
figNUM_THREAD_LOCAL_STORAGE_POINTERS - 1.
void vTaskSetThreadLocalStoragePointerAndDelCallback(TaskHandle_t xTaskToSet,
BaseType_t xIndex, void
*pvValue, TlsDeleteCallback-
Function_t pvDelCallback)
Set local storage pointer and deletion callback.
Each task contains an array of pointers that is dimensioned by the con-
figNUM_THREAD_LOCAL_STORAGE_POINTERS setting in FreeRTOSConfig.h. The kernel does
not use the pointers itself, so the application writer can use the pointers for any purpose they wish.
Local storage pointers set for a task can reference dynamically allocated resources. This function is similar to
vTaskSetThreadLocalStoragePointer, but provides a way to release these resources when the task gets deleted.
For each pointer, a callback function can be set. This function will be called when task is deleted, with the
local storage pointer index and value as arguments.
Parameters
• xTaskToSet: Task to set thread local storage pointer for
• xIndex: The index of the pointer to set, from 0 to con-
figNUM_THREAD_LOCAL_STORAGE_POINTERS - 1.
• pvValue: Pointer value to set.
• pvDelCallback: Function to call to dispose of the local storage pointer when the task is deleted.
void vApplicationGetIdleTaskMemory(StaticTask_t **ppxIdleTaskTCBBuffer, Stack-
Type_t **ppxIdleTaskStackBuffer, uint32_t
*pulIdleTaskStackSize)
This function is used to provide a statically allocated block of memory to FreeRTOS to hold the Idle Task TCB.
This function is required when configSUPPORT_STATIC_ALLOCATION is set. For more information see
this URI: https://www.FreeRTOS.org/a00110.html#configSUPPORT_STATIC_ALLOCATION
Parameters
• ppxIdleTaskTCBBuffer: A handle to a statically allocated TCB buffer
• ppxIdleTaskStackBuffer: A handle to a statically allocated Stack buffer for thie idle task
• pulIdleTaskStackSize: A pointer to the number of elements that will fit in the allocated
stack buffer
Espressif Systems 868
Submit Document Feedback
Release v4.4