Explorar el Código

[components][drivers][serial] serial.c 修复串口有时重复发送 '\r' 的问题 (#7767)

sp-cai hace 1 año
padre
commit
75f65b6af6
Se han modificado 1 ficheros con 1 adiciones y 2 borrados
  1. 1 2
      components/drivers/serial/serial.c

+ 1 - 2
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 --;