Serial communication service & queue

Hello group. I have a few question: 1. How to fast pure queue but not by while (xQueueReceive(…) == pdTRUE ) { /* Empty */} ?? 2. I also need function to fast see what is in queue. I can only read but I need something to read from queue with leave item in queue. In particular I need it to serial communication service (UART, RS-232 etc.). It have to be fast. Maybe it isn’t good solution to use Queue from freeRTOS with size item equal 1 byte to serial communication service? What you think? What you use? 3. Can I use vTaskResume() from ISR? I can’t find it in documentation.

Serial communication service & queue

1) Don’t know what you are asking, but there is no need to place the xQueueReceive() in a while loop if you are using a newer version of FreeRTOS. 2) Queue implementations in ISRs are not always a good idea.  It is best to use the DMA of FIFO of the peripheral to capture data, then a semaphore to wake a task to process the data.  This is much more efficient. 3) No – but there is a separate vTaskResumeFromISR() function that can be used.  Generally waking tasks from interrupts is best done using a semaphore as you will not get into a situation where the task suspends as the ISR is calling Resume.

Serial communication service & queue

1) Maybe, but how? How to fast clean Queue using freertos’ API. 3) Now i see, indeed there is vTaskResumeFromISR() …, strange, code-completion did not show me this function. (v4.1.3 and codeblocks 3960) But You did not write why use semaphores is better then resume task.