diff --git a/cores/esp32/esp32-hal-tinyusb.h b/cores/esp32/esp32-hal-tinyusb.h index 1067a9405c8..f929878d777 100644 --- a/cores/esp32/esp32-hal-tinyusb.h +++ b/cores/esp32/esp32-hal-tinyusb.h @@ -16,6 +16,7 @@ #include "esp32-hal.h" #if CONFIG_IDF_TARGET_ESP32S2 +#if CONFIG_USB_ENABLED #ifdef __cplusplus extern "C" { @@ -85,4 +86,5 @@ uint8_t tinyusb_get_free_out_endpoint(void); } #endif +#endif /* CONFIG_USB_ENABLED */ #endif /* CONFIG_IDF_TARGET_ESP32S2 */