Bird
0
0

What will happen if a task calls xEventGroupWaitBits() with waitForAllBits set to pdTRUE but only some bits are set?

medium📝 Predict Output Q5 of 15
FreeRTOS - Design Patterns for RTOS
What will happen if a task calls xEventGroupWaitBits() with waitForAllBits set to pdTRUE but only some bits are set?
AThe task will block until all specified bits are set
BThe task will immediately return with the bits set
CThe task will cause a runtime error
DThe task will ignore the bits and continue
Step-by-Step Solution
Solution:
  1. Step 1: Understand waitForAllBits parameter

    When waitForAllBits is pdTRUE, the task waits for all bits to be set before returning.
  2. Step 2: Behavior when only some bits are set

    The task blocks until all bits are set, so it does not return immediately.
  3. Final Answer:

    The task will block until all specified bits are set -> Option A
  4. Quick Check:

    waitForAllBits true means wait for all bits [OK]
Quick Trick: waitForAllBits true blocks until all bits set [OK]
Common Mistakes:
  • Thinking task returns immediately with partial bits
  • Assuming runtime error occurs
  • Ignoring waitForAllBits effect

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More FreeRTOS Quizzes