From 2d4c1acbfbbbb97c701fcd9e7f2afaf17f6d9bdb Mon Sep 17 00:00:00 2001 From: raphaelcoeffic <1050031+raphaelcoeffic@users.noreply.github.com> Date: Fri, 29 Mar 2024 09:49:41 +0100 Subject: [PATCH] fix(usb): use `usbPlugged()` to detect disconnect `cdcConnected` is updated from the UI task and cannot be used here. Fixes #4740 --- radio/src/cli.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radio/src/cli.cpp b/radio/src/cli.cpp index 797f90560..475a46034 100644 --- a/radio/src/cli.cpp +++ b/radio/src/cli.cpp @@ -1134,7 +1134,7 @@ int cliSerialPassthrough(const char **argv) cliReceiveCallBack = spInternalModuleTx; // loop until cable disconnected - while (cdcConnected) { + while (usbPlugged()) { uint32_t cli_br = cliGetBaudRate(); if (cli_br && (cli_br != (uint32_t)baudrate)) {