We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 247d1a5 commit 0fc7158Copy full SHA for 0fc7158
components/drivers/serial/serial.c
@@ -955,9 +955,7 @@ static void _tc_flush(struct rt_serial_device *serial, int queue)
955
{
956
RT_ASSERT(RT_NULL != rx_fifo);
957
level = rt_hw_interrupt_disable();
958
- rt_memset(rx_fifo->buffer, 0, serial->config.bufsz);
959
- rx_fifo->put_index = 0;
960
- rx_fifo->get_index = 0;
+ rx_fifo->get_index = rx_fifo->put_index;
961
rx_fifo->is_full = RT_FALSE;
962
rt_hw_interrupt_enable(level);
963
}
0 commit comments