ozsmit wrote on Wednesday, December 05, 2012:
Hi,
I am using
xQueueSendToBackFromISR(xButtonQueue, &button, &xHigherPriorityTaskWoken);
to send a Button key Parameter to a task waiting with:
while( xQueueReceive( xButtonQueue, &pcMessage, portMAX_DELAY ) != pdPASS );
I am seeing the same data being retreived from the queue even though the data being sent to it is changing in the ISR.
I have to press the next button 3 times for it to start to receive the correct info in the queue.
Here is my output terminal window:
Button Press (Actually pressed Mag Key)
Call Handle Magnification Key (Correct)
Button Press (Pressed Camera Key)
Call Handle Magnification Key (Wrong)
Button Press (Pressed Camera Key)
Call Handle Magnification Key (wrong)
Button Press (Pressed Camera Key)
Call Handle Camera Key (Correct)
Button Press (Pressed Mag key)
Call Handle Camera Key (wrong)
Button Press (Pressed Mag Key)
Call Handle Camera Key (wrong)
Button Press (Pressed Mag Key)
Call Handle Magnification Key (Correct)
I double checked to make sure that the IRQ has the proper button key value and that this value is sent to the queue using fromISR.
How does the Queue empty itself after I receive the previous data? Do I have to flush the Queue? Perhaps I am missing a sequence.
Thanks in advance,
Ozmit