Bird
0
0

Which of the following is the correct syntax to send a notification using xTaskNotifyGive() to a task handle named xTaskHandle?

easy📝 Syntax Q12 of 15
FreeRTOS - Task Notifications
Which of the following is the correct syntax to send a notification using xTaskNotifyGive() to a task handle named xTaskHandle?
AxTaskNotifyGive(xTaskHandle, 1);
BxTaskNotifyGive(&xTaskHandle);
CxTaskNotifyGive(xTaskHandle);
DxTaskNotifyGive();
Step-by-Step Solution
Solution:
  1. Step 1: Recall function signature

    xTaskNotifyGive() takes a task handle as a parameter, not a pointer or extra arguments.
  2. Step 2: Check each option

    xTaskNotifyGive(xTaskHandle); correctly passes the task handle. xTaskNotifyGive(&xTaskHandle); passes address (wrong), C adds an extra argument (wrong), D has no argument (wrong).
  3. Final Answer:

    xTaskNotifyGive(xTaskHandle); -> Option C
  4. Quick Check:

    Correct syntax = xTaskNotifyGive(xTaskHandle); [OK]
Quick Trick: Pass the task handle directly without extra arguments [OK]
Common Mistakes:
  • Passing pointer to task handle instead of handle itself
  • Adding extra parameters
  • Calling without any argument

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More FreeRTOS Quizzes