Complete the code to create a FreeRTOS task that prints "Hello".
xTaskCreate([1], "Task1", 1000, NULL, 1, NULL);
The function vTaskPrintHello is the task function that prints "Hello". It is passed to xTaskCreate to create the task.
Complete the code to start the FreeRTOS scheduler.
int main() {
// Setup code
[1]();
while(1) {}
}The function vTaskStartScheduler() starts the FreeRTOS scheduler, which begins running tasks.
Fix the error in the task function to yield control to other tasks.
void vTaskFunction(void *pvParameters) {
while(1) {
// Do work
[1](1);
}
}Using vTaskDelay(1) inside the loop allows the task to yield and lets other tasks run.
Fill both blanks to create a dictionary comprehension that maps task names to their priorities if priority is greater than 2.
task_priorities = {task[1]: priority for task, priority in tasks.items() if priority [2] 2}The task names are converted to uppercase with .upper(), and only tasks with priority greater than 2 are included.
Fill all three blanks to create a dictionary comprehension that maps uppercase task names to their priorities if priority is less than 5.
filtered_tasks = [1]: [2] for task, [3] in tasks.items() if priority < 5}}
The dictionary maps uppercase task names (task.upper()) to their priorities, filtering tasks with priority less than 5.