CMSIS v2 How to Wait for one of multiple different conditions?
Hi, my question is probably quite simple, but i have a surprisingly hard time finding an answer online:
I have a IO Task guarding my hardware. It takes data from a Tx Queue and pushes it to the hardware, and polls the hardware for Rx Messages which it pushes to the RxQueue.
I want to minimize polling and blocking as much as possible, so the task should poll Rx in interrupt mode and then wait for either the Tx Queue or the Interrupt to wake it.
I know how to wait for a queue, i know how to wait for an event flag or semaphore.
What i want to know is how to wait for either the queue or flag to be set.
I know i could require the Tx Producer to send a flag or just poll both uart and the tx Queue without waiting, but neither seems desirable.
Posted Sep 23, 2026, 8:22 AM UTC