Skip to content

Commit 1f78bd9

Browse files
authored
Theo fix for not recognizing HWCDC Port with Windows
1 parent 2cc0473 commit 1f78bd9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

cores/esp32/HWCDC.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,8 @@ void HWCDC::begin(unsigned long baud)
244244
}
245245

246246
// the HW Serial pins needs to be first deinited in order to allow `if(Serial)` to work :-(
247-
deinit(NULL);
248-
delay(10); // USB Host has to enumerate it again
247+
//deinit(NULL);
248+
//delay(10); // USB Host has to enumerate it again
249249

250250
// Peripheral Manager setting for USB D+ D- pins
251251
uint8_t pin = USB_DM_GPIO_NUM;
@@ -263,6 +263,7 @@ void HWCDC::begin(unsigned long baud)
263263
// Enable USB pad function
264264
USB_SERIAL_JTAG.conf0.usb_pad_enable = 1;
265265
usb_serial_jtag_ll_disable_intr_mask(USB_SERIAL_JTAG_LL_INTR_MASK);
266+
usb_serial_jtag_ll_clr_intsts_mask(USB_SERIAL_JTAG_LL_INTR_MASK);
266267
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);
267268
if(!intr_handle && esp_intr_alloc(ETS_USB_SERIAL_JTAG_INTR_SOURCE, 0, hw_cdc_isr_handler, NULL, &intr_handle) != ESP_OK){
268269
isr_log_e("HW USB CDC failed to init interrupts");

0 commit comments

Comments
 (0)