Hi Shu-nong:
RTOS Uart driver is blocking the current task until whole required data are received.
It works like this, in the UART ISR, when the predefined number of data has been received already, the callback functioin is called, the in the callback function, a semaphore is posted.
You can refer to the implementation of UART_RTOS_Receive function
int UART_RTOS_Receive(...)
{
...
ev = xEventGroupWaitBits(handle->rxEvent,
RTOS_UART_COMPLETE | RTOS_UART_RING_BUFFER_OVERRUN | RTOS_UART_HARDWARE_BUFFER_OVERRUN,
pdTRUE, pdFALSE, portMAX_DELAY);
...
}
If you needs to receive function to return immediately, I would suggest you try the following. modify the last parameter of xEventGroupWaitBits from portMAX_DELAY to a short value. for exampel 32 or other.
Regards
Daniel