From d2c2bc315523066e6e0b98156aff81dfd16fea4c Mon Sep 17 00:00:00 2001 From: mikeller Date: Sat, 16 Jun 2018 17:29:07 +1200 Subject: [PATCH] Reinstated USB connection debug. --- src/main/fc/fc_core.c | 2 -- src/main/fc/fc_tasks.c | 8 ++++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/fc/fc_core.c b/src/main/fc/fc_core.c index 5c5118aa6c..d6f4412016 100644 --- a/src/main/fc/fc_core.c +++ b/src/main/fc/fc_core.c @@ -40,12 +40,10 @@ #include "pg/rx.h" #include "drivers/light_led.h" -#include "drivers/serial_usb_vcp.h" #include "drivers/sound_beeper.h" #include "drivers/system.h" #include "drivers/time.h" #include "drivers/transponder_ir.h" -#include "drivers/usb_io.h" #include "sensors/acceleration.h" #include "sensors/barometer.h" diff --git a/src/main/fc/fc_tasks.c b/src/main/fc/fc_tasks.c index ed66f15c28..979871c53f 100644 --- a/src/main/fc/fc_tasks.c +++ b/src/main/fc/fc_tasks.c @@ -38,8 +38,10 @@ #include "drivers/compass/compass.h" #include "drivers/sensor.h" #include "drivers/serial.h" +#include "drivers/serial_usb_vcp.h" #include "drivers/stack_check.h" #include "drivers/transponder_ir.h" +#include "drivers/usb_io.h" #include "drivers/vtx_common.h" #include "fc/config.h" @@ -119,6 +121,12 @@ static bool taskSerialCheck(timeUs_t currentTimeUs, timeDelta_t currentDeltaTime static void taskHandleSerial(timeUs_t currentTimeUs) { UNUSED(currentTimeUs); + +#if defined(USE_VCP) + DEBUG_SET(DEBUG_USB, 0, usbCableIsInserted()); + DEBUG_SET(DEBUG_USB, 1, usbVcpIsConnected()); +#endif + #ifdef USE_CLI // in cli mode, all serial stuff goes to here. enter cli mode by sending # if (cliMode) {