diff options
| author | SummerGift <[email protected]> | 2019-07-23 16:15:24 +0800 |
|---|---|---|
| committer | SummerGift <[email protected]> | 2019-07-23 16:16:12 +0800 |
| commit | 0cfcb906d5dc126c5bcb7c0e639faf9b2c2f363e (patch) | |
| tree | 611b177d49706e45def427875ce29bda2d7899f8 /components | |
| parent | c94cac2e27fb8ac6813341a4604fdf65eed02e9e (diff) | |
【完善】去除串口 dma 中无法触发的代码判断
Diffstat (limited to 'components')
| -rw-r--r-- | components/drivers/serial/serial.c | 8 |
1 files 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; + } } /* |
