Complete the code to get the priority of a FreeRTOS task.
UBaseType_t priority = uxTaskPriorityGet([1]);The function uxTaskPriorityGet() requires the task handle as argument. Here, taskHandle is the correct variable name representing the task.
Complete the code to print the priority of a task using printf.
printf("Priority: %u\n", [1]);
getPriority().The function uxTaskPriorityGet(taskHandle) returns the priority, which can be printed directly.
Fix the error in the code to correctly get and store the task priority.
UBaseType_t [1] = uxTaskPriorityGet(taskHandle);UBaseType_t.The variable priority is a common and clear name to store the priority value returned by uxTaskPriorityGet().
Fill both blanks to create a dictionary comprehension that maps task names to their priorities for tasks with priority greater than 2.
{ [1]: uxTaskPriorityGet([2]) for [3] in tasks if uxTaskPriorityGet([3]) > 2 }uxTaskPriorityGet() with the correct argument.The dictionary comprehension maps each task's name (task.name) to its priority by calling uxTaskPriorityGet(task). The loop variable is task.
Fill all three blanks to create a dictionary comprehension that maps uppercase task names to their priorities for tasks with priority greater than 3.
{ [1]: [2] for [3] in task_list if uxTaskPriorityGet([3]) > 3 }The dictionary comprehension uses task.name.upper() as the key, and the priority from uxTaskPriorityGet(task) as the value. The loop variable is task.