mirror of
https://github.com/apache/nuttx.git
synced 2026-05-14 02:58:01 +08:00
575c608be8
Make sure that the cdcacm is disconnected before the usbdev gets unregistered. Also, check if the device is connected or not in cdcuart_txempty (uart_txempty). Otherwise there may be a crash during uart_tcdrain, called in tty close path, if the usbdev unregistration happens during the loop. This issue can be triggered by monitoring the cable connection status in one thread, sending BOARDIOC_USBDEV_DISCONNECT if the usb cable is detached. In another thread close the ttyACM. Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>