[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:
Meco Man 2022-08-04 19:08:28 -04:00 committed by Man, Jianting (Meco)
parent c33289ace7
commit 76885ca908
1 changed files with 1 additions and 1 deletions

View File

@ -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);