Complete the code to create an event group in FreeRTOS.
EventGroupHandle_t [1] = xEventGroupCreate();The function xEventGroupCreate() returns a handle to an event group, which we store in eventGroup.
Complete the code to wait for an event bit to be set in the event group.
EventBits_t bits = xEventGroupWaitBits(eventGroup, [1], pdTRUE, pdFALSE, portMAX_DELAY);The bit mask 0x01 waits for the first event bit to be set.
Fix the error in the code to set an event bit in the event group.
xEventGroup[1]Bits(eventGroup, 0x01);
The function to set bits in an event group is xEventGroupSetBits().
Fill both blanks to create an event group and check if a specific bit is set.
EventGroupHandle_t [1] = xEventGroupCreate(); if (xEventGroupGetBits([2]) & 0x02) { // Event bit 2 is set }
We create the event group with myEventGroup and check its bits using the same handle.
Fill all three blanks to set multiple event bits and then clear one bit.
xEventGroupSetBits([1], 0x03); xEventGroupClearBits([2], [3]);
We set bits 0 and 1 with 0x03, then clear bit 0 with 0x01 on the same event group handle.
