Bird
0
0

Which of the following is the correct syntax to change a task's priority using vTaskPrioritySet()?

easy📝 Syntax Q12 of 15
FreeRTOS - Task Priorities

Which of the following is the correct syntax to change a task's priority using vTaskPrioritySet()?

TaskHandle_t xTaskHandle;
// Change priority to 3
_____;
AvTaskPrioritySetPriority(xTaskHandle, 3);
BvTaskPrioritySet(xTaskHandle, 3);
CvTaskPrioritySet(3, xTaskHandle);
DvTaskSetPriority(xTaskHandle, 3);
Step-by-Step Solution
Solution:
  1. Step 1: Recall the function signature

    The correct function is vTaskPrioritySet(TaskHandle_t xTask, UBaseType_t uxNewPriority), so the task handle comes first, then the new priority.
  2. Step 2: Check the options

    vTaskPrioritySet(xTaskHandle, 3); matches the correct syntax exactly. Options A, B, and D either swap parameters or use incorrect function names.
  3. Final Answer:

    vTaskPrioritySet(xTaskHandle, 3); -> Option B
  4. Quick Check:

    Correct syntax = vTaskPrioritySet(task, priority) [OK]
Quick Trick: Function name and parameter order matter: task handle first [OK]
Common Mistakes:
  • Swapping the order of parameters
  • Using incorrect function names
  • Passing priority before task handle

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More FreeRTOS Quizzes