diff options
| author | yangjie <[email protected]> | 2019-07-27 18:08:11 +0800 |
|---|---|---|
| committer | yangjie <[email protected]> | 2019-07-27 18:08:11 +0800 |
| commit | 66abaa3818dc6fddb6b505e336e33890ea037bf3 (patch) | |
| tree | b2bfa8026338252398daa273b9bac6d620a061eb /components/drivers/serial | |
| parent | c794ac0255b0347cfd98b5751155cbfba1edc6b0 (diff) | |
| parent | 5180262010f5ed76f757125a75d54d37c289d022 (diff) | |
Merge branch 'master' of https://github.com/RT-Thread/rt-thread into dma
Diffstat (limited to 'components/drivers/serial')
| -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; + } } /* |
