Skip to content

Commit 94a5b5b

Browse files
authored
fixes usb_phy_ll include and call
1 parent 0daae59 commit 94a5b5b

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

cores/esp32/HWCDC.cpp

+9-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@
2626
#include "soc/io_mux_reg.h"
2727
#pragma GCC diagnostic ignored "-Wvolatile"
2828
#include "hal/usb_serial_jtag_ll.h"
29+
#if defined __has_include && __has_include ("hal/usb_phy_ll.h")
2930
#include "hal/usb_phy_ll.h"
31+
#else
32+
#include "hal/usb_fsls_phy_ll.h"
33+
#endif
3034
#pragma GCC diagnostic warning "-Wvolatile"
3135
#include "rom/ets_sys.h"
3236
#include "driver/usb_serial_jtag.h"
@@ -266,7 +270,11 @@ void HWCDC::begin(unsigned long baud)
266270
}
267271
}
268272
// Configure PHY
269-
usb_phy_ll_int_jtag_enable(&USB_SERIAL_JTAG);
273+
#if defined __has_include && __has_include ("hal/usb_phy_ll.h")
274+
usb_phy_ll_int_jtag_enable(&USB_SERIAL_JTAG);
275+
#else
276+
usb_fsls_phy_ll_int_jtag_enable(&USB_SERIAL_JTAG);
277+
#endif
270278
usb_serial_jtag_ll_disable_intr_mask(USB_SERIAL_JTAG_LL_INTR_MASK);
271279
usb_serial_jtag_ll_ena_intr_mask(USB_SERIAL_JTAG_INTR_SERIAL_IN_EMPTY | USB_SERIAL_JTAG_INTR_SERIAL_OUT_RECV_PKT | USB_SERIAL_JTAG_INTR_BUS_RESET);
272280
if(!intr_handle && esp_intr_alloc(ETS_USB_SERIAL_JTAG_INTR_SOURCE, 0, hw_cdc_isr_handler, NULL, &intr_handle) != ESP_OK){

0 commit comments

Comments
 (0)