I have a touch screen handler application. I want 2 queues to handle both incoming messages for screen touches, and a queue handler for outgoing messages back to the screen.
Separately, they both function with no problem. The queue for updating the screen can take messages using
xQueueSendToBack, and it updates the screen OK.
The queue for receiving messages works OK and receives messages from the screen. Right now, it just enumerates the message from the screen using the receive value. It’s set up like this:
void QueueProcessScreenCmds( void *pvParameters )
static uint8_t rxValue = 0;
QueueHandle_t xQueue = (QueueHandle_t) pvParameters;
xStatus = xQueueReceive( screenProcessQueue, &rxValue, rxQueue_RATE );
if( xStatus == pdPASS )
if( rxValue == THIS )
//do something with this
The problem is this – if I want to use the queue to “send” an update to the screen, it breaks. For example, if I want to send something to the queue in the “if rxValue == ” condition, like this:
xQueueSendToBack(xQueue, PR2, portMAX_DELAY );
It does not work. However, I can use that same call from a “regular” task I have created and it will function OK there.
What would be the reason I cannot send to the other queue from that task function? Or is there just a better way to do this?