Skip to content

Commit 61b43de

Browse files
authored
Fix compilation error when USB CDC on Boot is enabled (#2080)
When USB CDC on Boot is enabled on ESP32-C3, an compilation error occurs, because `Serial.begin()` takes only one (or zero) parameter. Check `ARDUINO_USB_CDC_ON_BOOT` and call it with the correct parameter.
1 parent d8aee22 commit 61b43de

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

examples/IRrecvDumpV2/IRrecvDumpV2.ino

+2
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ decode_results results; // Somewhere to store the results
130130
void setup() {
131131
#if defined(ESP8266)
132132
Serial.begin(kBaudRate, SERIAL_8N1, SERIAL_TX_ONLY);
133+
#elif ARDUINO_USB_CDC_ON_BOOT
134+
Serial.begin(kBaudRate);
133135
#else // ESP8266
134136
Serial.begin(kBaudRate, SERIAL_8N1);
135137
#endif // ESP8266

examples/IRrecvDumpV3/IRrecvDumpV3.ino

+2
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,8 @@ void setup() {
138138
OTAwifi(); // start default wifi (previously saved on the ESP) for OTA
139139
#if defined(ESP8266)
140140
Serial.begin(kBaudRate, SERIAL_8N1, SERIAL_TX_ONLY);
141+
#elif ARDUINO_USB_CDC_ON_BOOT
142+
Serial.begin(kBaudRate);
141143
#else // ESP8266
142144
Serial.begin(kBaudRate, SERIAL_8N1);
143145
#endif // ESP8266

0 commit comments

Comments
 (0)