[stm32][drv_serial] 修复recv_len意外为负(即很大正数)的问题
https://github.com/RT-Thread/rt-thread/issues/6106 https://github.com/RT-Thread/rt-thread/issues/4467#issuecomment-850814143
This commit is contained in:
parent
c33289ace7
commit
76885ca908
|
@ -489,7 +489,7 @@ static void dma_isr(struct rt_serial_device *serial)
|
|||
}
|
||||
else
|
||||
{
|
||||
recv_len = recv_total_index - uart->dma_rx.last_index;
|
||||
recv_len = serial->config.bufsz - uart->dma_rx.last_index + recv_total_index;
|
||||
}
|
||||
uart->dma_rx.last_index = recv_total_index;
|
||||
rt_hw_interrupt_enable(level);
|
||||
|
|
Loading…
Reference in New Issue