From 0cfcb906d5dc126c5bcb7c0e639faf9b2c2f363e Mon Sep 17 00:00:00 2001 From: SummerGift Date: Tue, 23 Jul 2019 16:15:24 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=AE=8C=E5=96=84=E3=80=91=E5=8E=BB?= =?UTF-8?q?=E9=99=A4=E4=B8=B2=E5=8F=A3=20dma=20=E4=B8=AD=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E8=A7=A6=E5=8F=91=E7=9A=84=E4=BB=A3=E7=A0=81=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/drivers/serial/serial.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/components/drivers/serial/serial.c b/components/drivers/serial/serial.c index 04034e8c44..e1d606557b 100644 --- a/components/drivers/serial/serial.c +++ b/components/drivers/serial/serial.c @@ -428,12 +428,10 @@ static void rt_dma_recv_update_put_index(struct rt_serial_device *serial, rt_siz } } - if(rx_fifo->is_full == RT_TRUE) + if(rx_fifo->is_full == RT_TRUE) { - rx_fifo->get_index = rx_fifo->put_index; - } - - if (rx_fifo->get_index >= serial->config.bufsz) rx_fifo->get_index = 0; + rx_fifo->get_index = rx_fifo->put_index; + } } /*