There is no way of looking through a queue without reading the items out. Peeking will only look at the head of the queue. Can you describe why you need to do this?
I have a queue that receives messages from multiple sources (buttons, SPI, UART etc.). Then according to which message it receives, it sets the hardware into a specific state (say Msg_MotorRunTest_Start). Such state in the software is nothing more than a loop inside a Switch-Case which can only be exited when a specific command (like Msg_MotorRunTest_Stop) is received.
I can exit it by sending a notification but I think the more correct/elegant way is to us the same messaging system/channel (i.e. the same Queue).
What about a task notification where you set some bits, and then use simple logical AND operations to test if desired bits are set, and process them in the order that you like?
Thank you @tomstorey
I am using MPLAB which until the next release supports only an older version of freeRTOS which has only 1 notification queue and have already used most of the 32 notification bits and want to keep few available is I need to add some functionality in the future. Also I already implemented a queue and have a lot of code already based on that functionality.
But thank you for that suggestion, I am always interested in suggestions and finding out how experienced programmers think and implement solutions.