I’m programming a board from TI, and I’d like to somehow be able to have two different ISR’s post to a task’s message queue. That part works fine. However, on the receiving end, is there any intelligent way for the task to pend on its queue and perform a different operation on the data based on which ISR posted?
Basically, I have an LCD update task that displays information from my motors. However, if I have a motor sensor ISR and a button press ISR that send different information to be updated, can this be done on one queue?
Sure. When each ISR sends a message to the queue, put something in the message that identifies the ISR that sent it. Then, when the receiver reads the queue, it can decide which action to take based on the identifier.
If an entire
charis too expensive, you can set just one bit (to0or1) to identify the ISR.