Skip to content

Commit 8b4c130

Browse files
feat(usb): Support the new USB IDF API (espressif#9761)
* feat(usb): Support the new USB IDF API Required for the latest ESP-IDF release/v5.1 * ci(pre-commit): Apply automatic fixes --------- Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
1 parent 97c98eb commit 8b4c130

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

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

+7-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,13 @@ 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 = {.dp_pu = 1, .dm_pu = 0, .dp_pd = 0, .dm_pd = 0};
511+
usb_serial_jtag_ll_phy_enable_pull_override(&pull_conf);
512+
usb_serial_jtag_ll_phy_disable_pull_override();
508513
#endif
509514
usb_serial_jtag_ll_disable_intr_mask(USB_SERIAL_JTAG_LL_INTR_MASK);
510515
usb_serial_jtag_ll_clr_intsts_mask(USB_SERIAL_JTAG_LL_INTR_MASK);

0 commit comments

Comments
 (0)