From 8f4733af0546d9d07cac0c8e5645ad1936107517 Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Sat, 2 Mar 2024 16:20:00 +0100 Subject: [PATCH 1/2] Fix compile with Lib Builder with latest IDF 5.1. --- cores/esp32/esp32-hal-tinyusb.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cores/esp32/esp32-hal-tinyusb.c b/cores/esp32/esp32-hal-tinyusb.c index d4ecd4428b4..a4628ae4165 100644 --- a/cores/esp32/esp32-hal-tinyusb.c +++ b/cores/esp32/esp32-hal-tinyusb.c @@ -42,8 +42,12 @@ #include "esp32s2/rom/usb/usb_dc.h" #include "esp32s2/rom/usb/chip_usb_dw_wrapper.h" #elif CONFIG_IDF_TARGET_ESP32S3 -#include "hal/usb_serial_jtag_ll.h" +#if defined __has_include && __has_include ("hal/usb_phy_ll.h") #include "hal/usb_phy_ll.h" +#else +#include "hal/usb_fsls_phy_ll.h" +#endif +#include "hal/usb_serial_jtag_ll.h" #include "esp32s3/rom/usb/usb_persist.h" #include "esp32s3/rom/usb/usb_dc.h" #include "esp32s3/rom/usb/chip_usb_dw_wrapper.h" From ee544a109c568f0b9fa8616746c00209779e5606 Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Sat, 2 Mar 2024 16:40:14 +0100 Subject: [PATCH 2/2] change function name --- cores/esp32/esp32-hal-tinyusb.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cores/esp32/esp32-hal-tinyusb.c b/cores/esp32/esp32-hal-tinyusb.c index a4628ae4165..fd0db206678 100644 --- a/cores/esp32/esp32-hal-tinyusb.c +++ b/cores/esp32/esp32-hal-tinyusb.c @@ -445,7 +445,11 @@ static void usb_switch_to_cdc_jtag(){ digitalWrite(USBPHY_DP_NUM, LOW); // Initialize CDC+JTAG ISR to listen for BUS_RESET + #if defined __has_include && __has_include ("hal/usb_phy_ll.h") usb_phy_ll_int_jtag_enable(&USB_SERIAL_JTAG); + #else + usb_fsls_phy_ll_int_jtag_enable(&USB_SERIAL_JTAG); + #endif usb_serial_jtag_ll_disable_intr_mask(USB_SERIAL_JTAG_LL_INTR_MASK); usb_serial_jtag_ll_clr_intsts_mask(USB_SERIAL_JTAG_LL_INTR_MASK); usb_serial_jtag_ll_ena_intr_mask(USB_SERIAL_JTAG_INTR_BUS_RESET);