0
0
FreeRTOSprogramming~10 mins

vTaskPrioritySet() dynamic 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 set the priority of a FreeRTOS task.

FreeRTOS
vTaskPrioritySet([1], 3);
Drag options to blanks, or click blank then click option'
Apriority
BTaskHandle_t
CxTaskHandle
DtaskHandle
Attempts:
3 left
💡 Hint
Common Mistakes
Using the priority value as the first argument.
Using the type name instead of a variable.
Using an undefined variable.
2fill in blank
medium

Complete the code to increase the priority of a task by 1.

FreeRTOS
vTaskPrioritySet(taskHandle, [1] + 1);
Drag options to blanks, or click blank then click option'
AuxTaskPriorityGet(taskHandle)
BtaskPriority
CpriorityLevel
DgetPriority()
Attempts:
3 left
💡 Hint
Common Mistakes
Using an undefined variable for priority.
Trying to call a method that does not exist.
Passing the priority value directly without getting current priority.
3fill in blank
hard

Fix the error in setting the task priority dynamically.

FreeRTOS
int newPriority = [1];
vTaskPrioritySet(taskHandle, newPriority);
Drag options to blanks, or click blank then click option'
ApriorityLevel + 1
BuxTaskPriorityGet(taskHandle) + 1
CgetPriority() + 1
DtaskPriority + 1
Attempts:
3 left
💡 Hint
Common Mistakes
Using variables that are not declared or initialized.
Using functions that do not exist in FreeRTOS.
Not adding 1 to the current priority.
4fill in blank
hard

Fill both blanks to create a dictionary of task names and their priorities for tasks with priority greater than 2.

FreeRTOS
taskPriorities = { [1]: uxTaskPriorityGet([2]) for [1] in taskList if uxTaskPriorityGet([1]) > 2 }
Drag options to blanks, or click blank then click option'
Atask
BtaskHandle
Cpriority
DtaskName
Attempts:
3 left
💡 Hint
Common Mistakes
Using different variables for key and value access.
Using undefined variables.
Confusing task names with task handles.
5fill in blank
hard

Fill all three blanks to create a dictionary mapping task names to their priorities for tasks with priority above 1.

FreeRTOS
taskPriorityDict = { [1]: [2] for [3] in tasks if [2] > 1 }
Drag options to blanks, or click blank then click option'
Atask.name
Btask.priority
Ctask
DuxTaskPriorityGet(task)
Attempts:
3 left
💡 Hint
Common Mistakes
Using undefined variables for keys or values.
Not calling the function to get priority.
Using the wrong variable in the loop.