diff options
| author | sp-cai <[email protected]> | 2023-07-08 11:52:32 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-07-07 23:52:32 -0400 |
| commit | 75f65b6af6e48f61e36e951aaa447bfc97e46773 (patch) | |
| tree | 21db59dfd226cfb017deb4858f36bb495b4bd642 | |
| parent | 67b38d1aad8877445d1e72e7db37896e0ba66321 (diff) | |
[components][drivers][serial] serial.c 修复串口有时重复发送 '\r' 的问题 (#7767)
| -rw-r--r-- | components/drivers/serial/serial.c | 3 |
1 files changed, 1 insertions, 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 --; |
