Bird
0
0

Which of the following correctly demonstrates how to notify a task using xTaskNotifyGive() if the task handle is xHandle?

easy📝 Syntax Q3 of 15
FreeRTOS - Task Notifications
Which of the following correctly demonstrates how to notify a task using xTaskNotifyGive() if the task handle is xHandle?
AxTaskNotifyGive(xHandle, 0);
BxTaskNotifyGive(&xHandle);
CxTaskNotifyGive();
DxTaskNotifyGive(xHandle);
Step-by-Step Solution
Solution:
  1. Step 1: Check function signature

    xTaskNotifyGive() takes a TaskHandle_t as its only parameter.
  2. Step 2: Analyze options

    xTaskNotifyGive(xHandle); passes the task handle correctly. xTaskNotifyGive(&xHandle); passes address of handle (incorrect). xTaskNotifyGive(); has no parameter. xTaskNotifyGive(xHandle, 0); has an extra parameter which is invalid.
  3. Final Answer:

    xTaskNotifyGive(xHandle); -> Option D
  4. Quick Check:

    Single task handle parameter [OK]
Quick Trick: Pass task handle directly to xTaskNotifyGive [OK]
Common Mistakes:
  • Passing address of task handle instead of handle
  • Omitting the parameter
  • Adding extra parameters

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More FreeRTOS Quizzes