diff --git a/components/arduino_tinyusb/CMakeLists.txt b/components/arduino_tinyusb/CMakeLists.txt index 6f1b3e2..8022c1c 100755 --- a/components/arduino_tinyusb/CMakeLists.txt +++ b/components/arduino_tinyusb/CMakeLists.txt @@ -26,9 +26,9 @@ if(CONFIG_TINYUSB_ENABLED) "${COMPONENT_DIR}/include") set(srcs # espressif: - "${COMPONENT_DIR}/src/dcd_esp32s2.c" + "${COMPONENT_DIR}/src/dcd_esp32sx.c" # tusb: - #"${COMPONENT_DIR}/tinyusb/src/portable/espressif/esp32s2/dcd_esp32s2.c" + #"${COMPONENT_DIR}/tinyusb/src/portable/espressif/esp32sx/dcd_esp32sx.c" "${COMPONENT_DIR}/tinyusb/src/class/cdc/cdc_device.c" "${COMPONENT_DIR}/tinyusb/src/class/hid/hid_device.c" "${COMPONENT_DIR}/tinyusb/src/class/midi/midi_device.c" diff --git a/components/arduino_tinyusb/src/dcd_esp32s2.c b/components/arduino_tinyusb/src/dcd_esp32sx.c similarity index 99% rename from components/arduino_tinyusb/src/dcd_esp32s2.c rename to components/arduino_tinyusb/src/dcd_esp32sx.c index 4ada95d..df466a0 100755 --- a/components/arduino_tinyusb/src/dcd_esp32s2.c +++ b/components/arduino_tinyusb/src/dcd_esp32sx.c @@ -27,16 +27,15 @@ */ #include "tusb_option.h" -#include "common/tusb_fifo.h" -#if CFG_TUSB_MCU == OPT_MCU_ESP32S2 && TUSB_OPT_DEVICE_ENABLED +#if (((CFG_TUSB_MCU == OPT_MCU_ESP32S2) || (CFG_TUSB_MCU == OPT_MCU_ESP32S3)) && TUSB_OPT_DEVICE_ENABLED) // Espressif #include "driver/periph_ctrl.h" #include "freertos/xtensa_api.h" #include "esp_intr_alloc.h" #include "esp_log.h" -#include "esp32s2/rom/gpio.h" +#include "driver/gpio.h" #include "soc/dport_reg.h" #include "soc/gpio_sig_map.h" #include "soc/usb_periph.h" @@ -299,6 +298,7 @@ bool dcd_edpt_open(uint8_t rhport, tusb_desc_endpoint_t const *desc_edpt) uint8_t const epnum = tu_edpt_number(desc_edpt->bEndpointAddress); uint8_t const dir = tu_edpt_dir(desc_edpt->bEndpointAddress); + TU_ASSERT(desc_edpt->wMaxPacketSize.size <= 64); TU_ASSERT(epnum < EP_MAX); xfer_ctl_t *xfer = XFER_CTL_BASE(epnum, dir); @@ -932,5 +932,5 @@ void dcd_int_disable (uint8_t rhport) esp_intr_free(usb_ih); } -#endif // OPT_MCU_ESP32S2 +#endif // #if OPT_MCU_ESP32S2 || OPT_MCU_ESP32S3