Task event management

Hi, I have the following pseudo code task_run() { while (true) { xTaskNotifyWait(eventA|eventB) if (eventA) { send RF command xTaskNotifyWait(eventA) }
if (eventB) { process command } do something else } } EventA is triggered by interrupt when RF data is received. EventB is triggered when application request to trigger a cmd I have the following issue when I have the following sequence – EventA received – task is woken up – EventB occurs before the second xTaskNotifyWait is called the first xTaskNotifyWait(eventA|eventB) will not detect eventB. to simulate I do the following task_run() { while (true) { xTaskNotifyWait(eventA|eventB) if (eventA) { trigger EventB send RF command xTaskNotifyWait(eventA) }
if (eventB) { process command } do something else } } Is that the expected behaviour? I would have expected that when waiting for a specific event, xTaskNotifyWait would only retrieve these specific events and if other event have been set they would be kept and available for other call to xTaskNotifyWait. Thanks for feedback.

Task event management

It looks like you are expecting the same behaviour as an event group, where bits are latched. That is not the case when using a notification, where you specify which bits to clear on exit from the wait function. If the eventB bit is set between the first and second calls to xTaskNotifyWait() then you will have to either remember it was set so you can then process it on the next go around the loop, or make sure the second call to xTaskNotifyWait() only clears the eventA bit so leaves the eventB bit set. If that does not explain the behaviour you are seeing, or you still have a problem, then please reply with the actual code so I can see the parameters you are passing and try to replicate it.