Skip to content

Commit 18659b1

Browse files
authored
Enable USB Serial only if selected
1 parent ccacb7e commit 18659b1

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

cores/esp32/HWCDC.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ void HWCDC::setDebugOutput(bool en)
436436
}
437437
}
438438

439-
#if ARDUINO_USB_MODE // Hardware JTAG CDC selected
439+
#if ARDUINO_USB_MODE && ARDUINO_USB_CDC_ON_BOOT // Hardware JTAG CDC selected
440440
// USBSerial is always available to be used
441441
HWCDC HWCDCSerial;
442442
#endif

cores/esp32/HWCDC.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ class HWCDC: public Stream
102102
uint32_t baudRate(){return 115200;}
103103

104104
};
105-
#if ARDUINO_USB_MODE // Hardware JTAG CDC selected
105+
#if ARDUINO_USB_MODE && ARDUINO_USB_CDC_ON_BOOT // Hardware JTAG CDC selected
106106
#ifndef HWCDC_SERIAL_IS_DEFINED
107107
#define HWCDC_SERIAL_IS_DEFINED 1
108108
#endif

cores/esp32/USBCDC.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ USBCDC::operator bool() const
455455
return connected;
456456
}
457457

458-
#if !ARDUINO_USB_MODE // Native USB CDC selected
458+
#if !ARDUINO_USB_MODE && ARDUINO_USB_CDC_ON_BOOT // Native USB CDC selected
459459
// USBSerial is always available to be used
460460
USBCDC USBSerial(0);
461461
#endif

cores/esp32/USBCDC.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ class USBCDC: public Stream
141141

142142
};
143143

144-
#if !ARDUINO_USB_MODE // Native USB CDC selected
144+
#if !ARDUINO_USB_MODE && ARDUINO_USB_CDC_ON_BOOT // Native USB CDC selected
145145
#ifndef USB_SERIAL_IS_DEFINED
146146
#define USB_SERIAL_IS_DEFINED 1
147147
#endif

0 commit comments

Comments
 (0)