I did not say that it was not correct. I said that your explanation was incorrect. More specifically, when you set xClearOnExit
to pdTRUE
, only the bits you are waiting for get cleared. And therefore, the following line in your previous explanation is incorrect -
When you set xClearOnExit
to pdTRUE
, your clearBitCount
variable is expected to increase. The reason that you see it increased only half the time is because your task is running slow and is not calling xEventGroupWaitBits
enough number of times. It should be easy to verify by removing the delay loops from the task. If it is determined, it is a CPU performance issue as I suggested before.