Skip to content

Commit 5bcaf99

Browse files
authored
Fix compile branch master as Arduino as component with latest IDF 5.1 (#9322)
* Fix compile with Lib Builder with latest IDF 5.1. * change function name
1 parent 629ffc5 commit 5bcaf99

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Diff for: cores/esp32/esp32-hal-tinyusb.c

+9-1
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,12 @@
4242
#include "esp32s2/rom/usb/usb_dc.h"
4343
#include "esp32s2/rom/usb/chip_usb_dw_wrapper.h"
4444
#elif CONFIG_IDF_TARGET_ESP32S3
45-
#include "hal/usb_serial_jtag_ll.h"
45+
#if defined __has_include && __has_include ("hal/usb_phy_ll.h")
4646
#include "hal/usb_phy_ll.h"
47+
#else
48+
#include "hal/usb_fsls_phy_ll.h"
49+
#endif
50+
#include "hal/usb_serial_jtag_ll.h"
4751
#include "esp32s3/rom/usb/usb_persist.h"
4852
#include "esp32s3/rom/usb/usb_dc.h"
4953
#include "esp32s3/rom/usb/chip_usb_dw_wrapper.h"
@@ -441,7 +445,11 @@ static void usb_switch_to_cdc_jtag(){
441445
digitalWrite(USBPHY_DP_NUM, LOW);
442446

443447
// Initialize CDC+JTAG ISR to listen for BUS_RESET
448+
#if defined __has_include && __has_include ("hal/usb_phy_ll.h")
444449
usb_phy_ll_int_jtag_enable(&USB_SERIAL_JTAG);
450+
#else
451+
usb_fsls_phy_ll_int_jtag_enable(&USB_SERIAL_JTAG);
452+
#endif
445453
usb_serial_jtag_ll_disable_intr_mask(USB_SERIAL_JTAG_LL_INTR_MASK);
446454
usb_serial_jtag_ll_clr_intsts_mask(USB_SERIAL_JTAG_LL_INTR_MASK);
447455
usb_serial_jtag_ll_ena_intr_mask(USB_SERIAL_JTAG_INTR_BUS_RESET);

0 commit comments

Comments
 (0)