Complete the code to set a task priority to the highest level in FreeRTOS.
vTaskPrioritySet(taskHandle, [1]);In FreeRTOS, priorities start at 0 (lowest) and go up to configMAX_PRIORITIES - 1 (highest). So the highest priority is configMAX_PRIORITIES - 1.
Complete the code to create a task with priority 2 in FreeRTOS.
xTaskCreate(taskFunction, "Task", 1000, NULL, [1], NULL);
The priority parameter sets the task priority. Here, setting it to 2 means the task has priority level 2.
Fix the error in setting a task priority to the highest level.
vTaskPrioritySet(taskHandle, [1]);The highest priority is configMAX_PRIORITIES - 1. Using configMAX_PRIORITIES is invalid and causes errors.
Fill both blanks to create a task with the lowest priority and then increase its priority by 1.
xTaskCreate(taskFunc, "Task", 500, NULL, [1], &handle); vTaskPrioritySet(handle, handle->uxPriority [2] 1);
The task is created with priority 0 (lowest). Then its priority is increased by 1 using the '+' operator.
Fill all three blanks to create a task with priority 3, then set its priority to the highest level.
xTaskCreate(func, "Tsk", 256, NULL, [1], &h); vTaskPrioritySet(h, [2]); configASSERT([3] <= configMAX_PRIORITIES - 1);
The task is created with priority 3. Then its priority is set to the highest level configMAX_PRIORITIES - 1. The assertion checks that the priority is valid by comparing the task's current priority h->uxPriority.