소스 검색

[drivers]serial.c

解决STM32串口使用DMA接收方式时,清空缓存bug
HubretXie 4 년 전
부모
커밋
0fc7158ffb
1개의 변경된 파일1개의 추가작업 그리고 3개의 파일을 삭제
  1. 1 3
      components/drivers/serial/serial.c

+ 1 - 3
components/drivers/serial/serial.c

@@ -955,9 +955,7 @@ static void _tc_flush(struct rt_serial_device *serial, int queue)
             {
                 RT_ASSERT(RT_NULL != rx_fifo);
                 level = rt_hw_interrupt_disable();
-                rt_memset(rx_fifo->buffer, 0, serial->config.bufsz);
-                rx_fifo->put_index = 0;
-                rx_fifo->get_index = 0;
+                rx_fifo->get_index = rx_fifo->put_index;
                 rx_fifo->is_full = RT_FALSE;
                 rt_hw_interrupt_enable(level);
             }