0
0
FreeRTOSprogramming~10 mins

uxTaskPriorityGet() for reading priority in FreeRTOS - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to get the priority of a FreeRTOS task.

FreeRTOS
UBaseType_t priority = uxTaskPriorityGet([1]);
Drag options to blanks, or click blank then click option'
AxTask
BxTaskHandle
CtaskHandle
Dhandle
Attempts:
3 left
💡 Hint
Common Mistakes
Using a variable name that is not the task handle.
Passing the task name as a string instead of the handle.
2fill in blank
medium

Complete the code to print the priority of a task using printf.

FreeRTOS
printf("Priority: %u\n", [1]);
Drag options to blanks, or click blank then click option'
AuxTaskPriorityGet(taskHandle)
BtaskPriority
Cpriority
DgetPriority(taskHandle)
Attempts:
3 left
💡 Hint
Common Mistakes
Using a variable that is not initialized with the priority.
Calling a non-existent function like getPriority().
3fill in blank
hard

Fix the error in the code to correctly get and store the task priority.

FreeRTOS
UBaseType_t [1] = uxTaskPriorityGet(taskHandle);
Drag options to blanks, or click blank then click option'
Apriority
Bprio
CtaskPriority
DpriorityLevel
Attempts:
3 left
💡 Hint
Common Mistakes
Using variable names that are not descriptive or confusing.
Not declaring the variable with the correct type UBaseType_t.
4fill in blank
hard

Fill both blanks to create a dictionary comprehension that maps task names to their priorities for tasks with priority greater than 2.

FreeRTOS
{ [1]: uxTaskPriorityGet([2]) for [3] in tasks if uxTaskPriorityGet([3]) > 2 }
Drag options to blanks, or click blank then click option'
Atask.name
Btask
Ct
DtaskHandle
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong variable name in the loop.
Not calling uxTaskPriorityGet() with the correct argument.
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that maps uppercase task names to their priorities for tasks with priority greater than 3.

FreeRTOS
{ [1]: [2] for [3] in task_list if uxTaskPriorityGet([3]) > 3 }
Drag options to blanks, or click blank then click option'
Atask.name.upper()
BuxTaskPriorityGet(task)
Ctask
DtaskHandle
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong variable for the loop.
Not converting the task name to uppercase.