I apologize if I’m reposting. Using search engines (and copilot) can’t seem to provide an answer to help me grasp what I’m missing. I’m working through the fundamentals of settings and clearing bits in an event group.
Relevant code:
#define BIT_0 (1 << 0) //Pretty much straight from FreeRTOS.org docs
#define BIT_4 (1 << 4) //Define my bits I want to manipulate
EventGroupHandle_t xCreatedEventGroup; //create my event group
if (!(xCreatedEventGroup = xEventGroupCreate()))
{
ESP_LOGI(TAG, "Error creating xCreatedEventGroup");
}
else
{
EventBits_t uxBits;
uxBits = xEventGroupSetBits(
xCreatedEventGroup,
BIT_0 | BIT_4);
if (uxBits & BIT_0)
ESP_LOGI(TAG, "BIT_0 set"); //These will print
if (uxBits & BIT_4)
ESP_LOGI(TAG, "BIT_4 set");
uxBits = xEventGroupClearBits(
xCreatedEventGroup,
BIT_0 | BIT_4);
if (uxBits & BIT_0) //This still prints which it should return 0 correct?
ESP_LOGI(TAG, "BIT_0 not cleared");
}
I feel like I’m missing something incredibly basic, but for the life of me I can’t figure out what it is. Any help/guidance would be extremely appreciated.