Bird
0
0

Which of the following is the correct syntax to send a notification with a value using xTaskNotify()?

easy📝 Syntax Q12 of 15
FreeRTOS - Task Notifications

Which of the following is the correct syntax to send a notification with a value using xTaskNotify()?

BaseType_t xTaskNotify( TaskHandle_t xTaskToNotify, uint32_t ulValue, eNotifyAction eAction );
AxTaskNotify(taskHandle, 10, eSetBits);
BxTaskNotify(10, taskHandle, eSetValueWithOverwrite);
CxTaskNotify(taskHandle, eSetValueWithoutOverwrite, 10);
DxTaskNotify(eSetValueWithOverwrite, taskHandle, 10);
Step-by-Step Solution
Solution:
  1. Step 1: Identify parameter order in xTaskNotify()

    The correct order is: TaskHandle_t, uint32_t value, eNotifyAction.
  2. Step 2: Match options to correct order

    xTaskNotify(taskHandle, 10, eSetBits); matches the correct order: taskHandle, 10, eSetBits. Others mix parameter order incorrectly.
  3. Final Answer:

    xTaskNotify(taskHandle, 10, eSetBits); -> Option A
  4. Quick Check:

    Correct parameter order: task, value, action [OK]
Quick Trick: Remember parameter order: task, value, action [OK]
Common Mistakes:
  • Swapping value and task handle parameters
  • Using wrong enum for eNotifyAction
  • Passing parameters in wrong order

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More FreeRTOS Quizzes