0
0
FreeRTOSprogramming~5 mins

vTaskPrioritySet() dynamic priority in FreeRTOS - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
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?
ATask handle and stack size
BOnly the new priority value
CTask handle and new priority value
DTask name and new priority value
If you increase a task's priority using vTaskPrioritySet(), what might happen immediately?
AThe task will be deleted
BNothing will happen until the task yields
CThe system will reboot
DThe scheduler may switch to that task right away
Can vTaskPrioritySet() be safely called from an interrupt service routine (ISR)?
ANo, it must be called from a task
BYes, always
COnly if interrupts are disabled
DOnly if the task is suspended
What is the valid range for the priority value passed to vTaskPrioritySet()?
AAny integer value
BFrom 0 (lowest) to configMAX_PRIORITIES - 1
COnly 0 or 1
DFrom 1 to 10
What happens if you set a task's priority lower than other ready tasks?
AThe task may be preempted by higher priority tasks
BThe task will run immediately
CThe task will be deleted
DThe system will halt
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.