diff --git a/lib/main/STM32_USB_OTG_Driver/src/usb_core.c b/lib/main/STM32_USB_OTG_Driver/src/usb_core.c index 7f7552d2d..6c552896b 100644 --- a/lib/main/STM32_USB_OTG_Driver/src/usb_core.c +++ b/lib/main/STM32_USB_OTG_Driver/src/usb_core.c @@ -392,12 +392,9 @@ USB_OTG_STS USB_OTG_CoreInit(USB_OTG_CORE_HANDLE *pdev) /* Deactivate the power down*/ gccfg.d32 = 0; gccfg.b.pwdn = 1; -#ifdef VBUS_SENSING_ENABLED - gccfg.b.vbussensingA = 1 ; - gccfg.b.vbussensingB = 1 ; -#else + + // XXX Betaflight mod; disabled VBUS sensing features completely, including Sense A and B. gccfg.b.disablevbussensing = 1; -#endif if(pdev->cfg.Sof_output) { diff --git a/src/main/drivers/usb_io.c b/src/main/drivers/usb_io.c index c32d62c49..0b18d82fb 100644 --- a/src/main/drivers/usb_io.c +++ b/src/main/drivers/usb_io.c @@ -59,7 +59,9 @@ bool usbCableIsInserted(void) bool result = false; #ifdef USE_USB_DETECT - result = IORead(usbDetectPin) != 0; + if (usbDetectPin) { + result = IORead(usbDetectPin) != 0; + } #endif return result; diff --git a/src/main/target/KROOZX/target.h b/src/main/target/KROOZX/target.h index b0d5b366d..05e7311fc 100644 --- a/src/main/target/KROOZX/target.h +++ b/src/main/target/KROOZX/target.h @@ -95,8 +95,6 @@ #define CURRENT_METER_OFFSET_DEFAULT 0 #define USE_VCP -#define USE_USB_DETECT -//#define USB_DETECT_PIN PA9 #define USE_UART1 #define UART1_RX_PIN PA10