Complete the code to create an event group.
EventGroupHandle_t [1] = xEventGroupCreate();The function xEventGroupCreate() creates an event group and returns its handle. Naming it eventGroup is clear and appropriate.
Complete the code to wait for event bits to be set.
xEventGroupWaitBits(eventGroup, [1], pdTRUE, pdFALSE, portMAX_DELAY);The bit mask 0x01 waits for the first event bit to be set.
Fix the error in setting event bits.
xEventGroup[1]Bits(eventGroup, 0x01);
The function xEventGroupSetBits() sets the specified bits in the event group.
Fill both blanks to create and wait for event bits correctly.
EventGroupHandle_t [1] = xEventGroupCreate(); uint32_t bits = xEventGroupWaitBits([2], 0x03, pdTRUE, pdFALSE, portMAX_DELAY);
We create an event group named eventGroup and then wait for bits on the same event group handle.
Fill all three blanks to set bits, wait for them, and clear bits properly.
xEventGroup[1]Bits(eventGroup, 0x01); uint32_t bits = xEventGroupWaitBits(eventGroup, 0x01, [2], pdFALSE, portMAX_DELAY); xEventGroup[3]Bits(eventGroup, 0x01);
First, we set the bit with xEventGroupSetBits(). Then we wait for the bit with pdTRUE to clear it automatically after waiting. Finally, we can clear bits explicitly with xEventGroupClearBits().
