From 07fc969b37113d7c44dbf05b7b7d22f2b6d7e14d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=94=A1=E6=9F=B3=E6=9E=97?= Date: Mon, 3 Jul 2023 03:54:00 +0000 Subject: [PATCH] =?UTF-8?q?update=20components/drivers/serial/serial.c.=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=B2=E5=8F=A3=E6=9C=89=E6=97=B6=E9=87=8D?= =?UTF-8?q?=E5=A4=8D=E5=8F=91=E9=80=81=20'\r'=20=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98=20=E6=9C=89=E6=97=B6=20serial->ops->putc(serial,=20(c?= =?UTF-8?q?har)data)=20=E5=A4=B1=E8=B4=A5=E5=90=8E=EF=BC=8C=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=20serial->ops->putc(serial,=20'\r')=20=E9=87=8D?= =?UTF-8?q?=E5=A4=8D=E6=89=A7=E8=A1=8C=20=EF=BC=88=E8=A1=A8=E7=8E=B0?= =?UTF-8?q?=E4=B8=BA=E4=B8=B2=E5=8F=A3=E6=9C=89=E6=97=B6=E5=A4=9A=E8=BE=93?= =?UTF-8?q?=E5=87=BA=E4=BA=86=E2=80=98\r=E2=80=99=EF=BC=89=EF=BC=8C?= =?UTF-8?q?=E6=AD=A4=E4=BF=AE=E6=94=B9=E5=8F=AF=E4=BB=A5=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=AD=A4=E9=97=AE=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 蔡柳林 --- components/drivers/serial/serial.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/components/drivers/serial/serial.c b/components/drivers/serial/serial.c index fe5ea0f294..fd904078f7 100644 --- a/components/drivers/serial/serial.c +++ b/components/drivers/serial/serial.c @@ -359,10 +359,9 @@ rt_inline int _serial_int_tx(struct rt_serial_device *serial, const rt_uint8_t * } } - if (serial->ops->putc(serial, *(char*)data) == -1) + while (serial->ops->putc(serial, *(char*)data) == -1) { rt_completion_wait(&(tx->completion), RT_WAITING_FOREVER); - continue; } data ++; length --; -- Gitee