Complete the code to create a FreeRTOS task with the correct priority.
xTaskCreate(taskFunction, "Task1", 1000, NULL, [1], NULL);
The task priority must be set to tskIDLE_PRIORITY or higher. Here, tskIDLE_PRIORITY is the lowest priority, ensuring the task runs when no higher priority tasks are ready.
Complete the code to start the FreeRTOS scheduler.
int main(void) {
// Setup code
[1]();
for(;;) {}
}The scheduler is started by calling vTaskStartScheduler(). This begins task switching based on priorities.
Fix the error in the task delay call to ensure the task yields correctly.
void taskFunction(void *pvParameters) {
for(;;) {
// Do work
vTaskDelay([1]);
}
}Delays in FreeRTOS must be specified in ticks. Dividing milliseconds by portTICK_PERIOD_MS converts ms to ticks.
Fill both blanks to create a dictionary comprehension that maps task names to their priorities for tasks with priority greater than 1.
task_priorities = {task.name: task.priority for task in tasks if task.priority [1] [2]The comprehension filters tasks with priority greater than 1 using > and 1.
Fill all three blanks to create a dictionary comprehension that maps uppercase task names to their stack sizes for tasks with stack size greater than 512.
task_info = { [1]: [2] for task in tasks if task.stack_size [3] 512 }The comprehension maps uppercase task names to stack sizes for tasks with stack size greater than 512.