Browse Source

fix: 修复usb_vuart虚拟串口无法正常触发rx回调

??? 10 months ago
parent
commit
9a0a5b9b86
1 changed files with 3 additions and 0 deletions
  1. 3 0
      luat/modules/luat_lib_uart.c

+ 3 - 0
luat/modules/luat_lib_uart.c

@@ -324,6 +324,9 @@ static int luat_uart_soft_write(const uint8_t *data, uint32_t len)
 
 #ifdef LUAT_USE_DRV_UART
 int luat_drv_uart_exist(int id) {
+	if (id >= LUAT_VUART_ID_0) 
+		return 1;
+
 	return id >= 0 && id <= MAX_DEVICE_COUNT + MAX_USB_DEVICE_COUNT;
 }
 #endif