Hello,
I found the following behavior of xEventGroupWaitBits function.
I have 2 tasks.
in the 1st task I do smth like:
xEventGroupWaitBits(handle, bits, …., portMAXDELAY_)
in the 2nd task I do smth like:
vTaskSuspend(handletask1);
activity();
vTaskResume(handletask1);
in the task1 the function xEventGroupWaitBits exits immediately right after vtaskResume even if no bits were set.
Is this a correct behavior?
Best regards, Alexey
xEventGroupWaitBits unexpected behavior
xEventGroupWaitBits unexpected behavior
That is expected – unlike in the queue receive functions, which have an
outer loop to keep re-testing, there is nothing in the
xEventGroupWaitBits() function that will re-test the block condition
when the task blocked task leaves the blocked state.
xEventGroupWaitBits unexpected behavior
.
xEventGroupWaitBits unexpected behavior
Is it possible to get any kind of notification about “unexpected exit from xEventGroupWaitBits” in case of a task resume?
xEventGroupWaitBits unexpected behavior
If the task that is waiting for event bits is also being suspended and
resumed then you could check the time before calling
xEventGroupWaitBits(), and then if the function returns without any bits
being set, check the time again to know if the function returned because
of a timeout. If the requested block time has not expired, and no bits
are set, then you could assume the function returned because the task
got suspended and then resumed again.