Complete the code to enable static allocation support in FreeRTOS.
#define configSUPPORT_STATIC_ALLOCATION [1]
Setting configSUPPORT_STATIC_ALLOCATION to 1 enables static allocation support in FreeRTOS.
Complete the function prototype for creating a task with static allocation.
TaskHandle_t xTaskCreateStatic( TaskFunction_t pxTaskCode, const char * const pcName, const uint32_t ulStackDepth, void * const pvParameters, UBaseType_t uxPriority, StackType_t * const [1], StaticTask_t * const pxTaskBuffer );The parameter puxStackBuffer is the pointer to the stack buffer for the task.
Fix the error in the following code snippet for static task creation.
StaticTask_t xTaskBuffer; StackType_t xStackBuffer[[1]]; xTaskCreateStatic( vTaskCode, "Task", 128, NULL, 2, xStackBuffer, &xTaskBuffer );
The stack buffer size must match the stack depth parameter (128) to avoid stack overflow or memory issues.
Fill both blanks to define a static task and its stack correctly.
StaticTask_t [1]; StackType_t [2][256];
Common naming conventions use xTaskBuffer for the task control block and xStackBuffer for the stack array.
Fill all three blanks to create a static task with correct parameters.
TaskHandle_t [1] = xTaskCreateStatic( vTaskFunction, "StaticTask", [2], NULL, 1, [3], &xTaskBuffer );
xHandle stores the task handle, 128 is the stack depth, and xStackBuffer is the stack array pointer.