Skip to content

Commit 345087c

Browse files
authored
feat: Moved SOF function
1 parent 9d2db24 commit 345087c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

cores/esp32/HWCDC.h

+7-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include <inttypes.h>
2222
#include "esp_event.h"
2323
#include "Stream.h"
24+
#include "hal/usb_serial_jtag_ll.h"
2425

2526
ESP_EVENT_DECLARE_BASE(ARDUINO_HW_CDC_EVENTS);
2627

@@ -69,7 +70,12 @@ class HWCDC : public Stream {
6970
size_t write(const uint8_t *buffer, size_t size);
7071
void flush(void);
7172

72-
static bool isPlugged(void);
73+
inline static bool isPlugged(void) {
74+
// SOF ISR is causing esptool to be unable to upload firmware to the board
75+
// Using IDF 5.1 helper function because it is based on Timer check instead of ISR
76+
return usb_serial_jtag_is_connected();
77+
}
78+
7379
inline static bool isConnected(void) {
7480
return isCDC_Connected();
7581
}

0 commit comments

Comments
 (0)