Skip to content

Commit eba2949

Browse files
committed
feat(usb): Support the new USB IDF API
Required for the latest ESP-IDF release/v5.1
1 parent 746cb90 commit eba2949

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

cores/esp32/esp32-hal-tinyusb.c

+12-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
#elif CONFIG_IDF_TARGET_ESP32S3
4444
#if defined __has_include && __has_include("hal/usb_phy_ll.h")
4545
#include "hal/usb_phy_ll.h"
46-
#else
46+
#elif defined __has_include && __has_include("hal/usb_fsls_phy_ll.h")
4747
#include "hal/usb_fsls_phy_ll.h"
4848
#endif
4949
#include "hal/usb_serial_jtag_ll.h"
@@ -503,8 +503,18 @@ static void usb_switch_to_cdc_jtag() {
503503
// Initialize CDC+JTAG ISR to listen for BUS_RESET
504504
#if defined __has_include && __has_include("hal/usb_phy_ll.h")
505505
usb_phy_ll_int_jtag_enable(&USB_SERIAL_JTAG);
506-
#else
506+
#elif defined __has_include && __has_include("hal/usb_fsls_phy_ll.h")
507507
usb_fsls_phy_ll_int_jtag_enable(&USB_SERIAL_JTAG);
508+
#else
509+
// usb_serial_jtag_ll_phy_set_defaults();
510+
const usb_serial_jtag_pull_override_vals_t pull_conf = {
511+
.dp_pu = 1,
512+
.dm_pu = 0,
513+
.dp_pd = 0,
514+
.dm_pd = 0
515+
};
516+
usb_serial_jtag_ll_phy_enable_pull_override(&pull_conf);
517+
usb_serial_jtag_ll_phy_disable_pull_override();
508518
#endif
509519
usb_serial_jtag_ll_disable_intr_mask(USB_SERIAL_JTAG_LL_INTR_MASK);
510520
usb_serial_jtag_ll_clr_intsts_mask(USB_SERIAL_JTAG_LL_INTR_MASK);

0 commit comments

Comments
 (0)