FreeRTOS queues and ISRs
2006-01-23 by Guillermo Prandi
Hi. Perhaps this is not the right place to post this, so sorry if it is not. I am implementing FreeRTOS in my LPC2138 board. I am using the queue mechanism to serve the serial ports (this include an SPI port). In the ISRs I am using the xQueueSendFromISR() and xQueueReceiveFromISR () functions, to whom I pass the xTaskPreviouslyWoken parameter with a pdFALSE the first time and, if the same ISR calls another QUEUE function, the xTaskPreviouslyWoken parameter gets the return value from a previous call. This seems pretty straightforward, but then I realized that I might be wrong. These are the questions that come to my mind: - If xQueueSendFromISR() returns pdTRUE, should a further call to xQueueSendFromISR() but to a different queue get xTaskPreviouslyWoken = pdTRUE? - If xQueueSendFromISR() returns pdTRUE, should a further call to xQueueReceiveFromISR() get xTaskPreviouslyWoken = pdTRUE? Or vice- versa. - What happens if two consecutive interrupts are served, the first interrupt gets a pdTRUE from -let's say- xQueueSendFromISR() and the second interrupt occurs before the woken task had had any scheduled time. Could a call to xQueueSendFromISR() with xTaskPreviouslyWoken = pdFALSE be harmful? i.e., the second interrupt knows nothing about the pdTRUE got from the first interrupt call. Thanks in advance. Guille