Recall & Review
beginner
What does the function
vTaskPrioritySet() do in FreeRTOS?It changes the priority of a specified task dynamically while the system is running.
Click to reveal answer
beginner
Why would you want to change a task's priority dynamically using
vTaskPrioritySet()?To allow more important tasks to run sooner or to adjust task behavior based on system conditions.
Click to reveal answer
intermediate
What happens if you set a task's priority higher than the currently running task using
vTaskPrioritySet()?The scheduler may immediately switch to the higher priority task, preempting the current one.
Click to reveal answer
intermediate
Can
vTaskPrioritySet() be called from an interrupt service routine (ISR)?No, it must be called from a task context, not from an ISR.
Click to reveal answer
beginner
What is the effect of setting a task's priority to the same value it already has using
vTaskPrioritySet()?No change occurs; the task priority remains the same and the scheduler does not switch tasks.
Click to reveal answer
What parameter does
vTaskPrioritySet() require to change a task's priority?✗ Incorrect
vTaskPrioritySet() needs the task handle to identify the task and the new priority value to set.
If you increase a task's priority using
vTaskPrioritySet(), what might happen immediately?✗ Incorrect
Increasing priority can cause immediate preemption by the scheduler to run the higher priority task.
Can
vTaskPrioritySet() be safely called from an interrupt service routine (ISR)?✗ Incorrect
This function is designed to be called from tasks, not ISRs.
What is the valid range for the priority value passed to
vTaskPrioritySet()?✗ Incorrect
Priorities must be within the configured range defined by configMAX_PRIORITIES.
What happens if you set a task's priority lower than other ready tasks?
✗ Incorrect
Lower priority means the task can be preempted by tasks with higher priority.
Explain how
vTaskPrioritySet() affects task scheduling in FreeRTOS.Think about how changing priority changes which task runs first.
You got /4 concepts.
Describe a scenario where changing a task's priority dynamically with
vTaskPrioritySet() is useful.Consider real-life situations where some jobs become more urgent.
You got /3 concepts.