rt-thread
rt-thread copied to clipboard
[Feature] _serial_fifo_rx in serial.c can be better
Describe problem solved by the proposed feature
_serial_fifo_rx with RT_SERIAL_RX_BLOCKING in serial.c is limited by the buffer size
1.when needed size is large than ringbuffer size, _serial_fifo_rx will do nothing.
2.when needed size is large than readable size, _serial_fifo_rx will update rx_fifo->rx_cpt_index = size and wait for rx_fifo->rx_cpt, but do nothing else.
The above results in data loss.
Describe your preferred solution
_serial_fifo_rx with RT_SERIAL_RX_BLOCKING in serial.c, maybe can waiting for dma intrrupt event to copy readable data to user buffer several times, until readed data size is enough. When readable size is large then user read size, data can be copied directly.
Describe possible alternatives
No response