Bird
0
0

Which of the following is the correct way to set a task priority in FreeRTOS?

easy📝 Syntax Q12 of 15
FreeRTOS - Task Priorities

Which of the following is the correct way to set a task priority in FreeRTOS?

vTaskPrioritySet(
AvTaskPrioritySet(TaskHandle_t xTask);
BvTaskPrioritySet(TaskHandle_t xTask, UBaseType_t uxNewPriority);
CvTaskPrioritySet(UBaseType_t uxNewPriority, TaskHandle_t xTask);
DvTaskPrioritySet(UBaseType_t uxNewPriority);
Step-by-Step Solution
Solution:
  1. Step 1: Recall FreeRTOS API for setting priority

    The function vTaskPrioritySet requires the task handle and the new priority as parameters.
  2. Step 2: Check parameter order

    The correct order is first the task handle, then the new priority value.
  3. Final Answer:

    vTaskPrioritySet(TaskHandle_t xTask, UBaseType_t uxNewPriority); -> Option B
  4. Quick Check:

    Correct parameter order = C [OK]
Quick Trick: Task handle first, then priority in vTaskPrioritySet [OK]
Common Mistakes:
  • Swapping parameter order
  • Missing one parameter
  • Using wrong parameter types

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More FreeRTOS Quizzes