diff --git a/STM32/cores/arduino/main.cpp b/STM32/cores/arduino/main.cpp index fe2ecda..3c00744 100644 --- a/STM32/cores/arduino/main.cpp +++ b/STM32/cores/arduino/main.cpp @@ -47,7 +47,9 @@ int main(void) initVariant(); + #if defined(USB_BASE) || defined(USB_OTG_DEVICE_BASE) USBDeviceFS.beginMenuSelection(); + #endif setup(); diff --git a/STM32/cores/arduino/stm32/USBDevice.cpp b/STM32/cores/arduino/stm32/USBDevice.cpp index 3cae51c..c2b5bc6 100644 --- a/STM32/cores/arduino/stm32/USBDevice.cpp +++ b/STM32/cores/arduino/stm32/USBDevice.cpp @@ -22,6 +22,8 @@ #include "Arduino.h" +#if defined(USB_BASE) || defined(USB_OTG_DEVICE_BASE) + #include "USBDevice.h" #include "usbd_core.h" #include "usbd_desc.h" @@ -123,3 +125,5 @@ extern "C" void USBSerial_Rx_Handler(uint8_t *data, uint16_t len){ USBD_HandleTypeDef hUsbDeviceFS; USBDeviceClass USBDeviceFS; + +#endif