From 8f0cef3a87efa3306fc24dcc0758cbf555a60acb Mon Sep 17 00:00:00 2001 From: wdfk-prog <1425075683@qq.com> Date: Thu, 5 Jan 2023 14:25:16 +0800 Subject: [PATCH] =?UTF-8?q?[drivers][serial=5Fv2]=E4=BF=AE=E5=A4=8DDMA+TX?= =?UTF-8?q?=E9=98=BB=E5=A1=9E=E6=A8=A1=E5=BC=8F=E5=BC=82=E5=B8=B8=20(#6781?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [drivers][serial_v2]修复DMA+TX阻塞模式异常 --- components/drivers/serial/serial_v2.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/drivers/serial/serial_v2.c b/components/drivers/serial/serial_v2.c index fc03605c1d..5784f1fee7 100644 --- a/components/drivers/serial/serial_v2.c +++ b/components/drivers/serial/serial_v2.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2021, RT-Thread Development Team + * Copyright (c) 2006-2022, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -694,6 +694,7 @@ static rt_err_t rt_serial_tx_enable(struct rt_device *dev, tx_fifo->activated = RT_FALSE; tx_fifo->put_size = 0; + rt_memset(&tx_fifo->rb, RT_NULL, sizeof(tx_fifo->rb)); rt_completion_init(&(tx_fifo->tx_cpt)); dev->open_flag |= RT_SERIAL_TX_BLOCKING;