Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit f7e8b9f

Browse files
authoredFeb 22, 2024
fix: fixes issues with Ubuntu CI
Only compiles the example in case it is using Hardware CD and JTAG mode.
1 parent ec05cd1 commit f7e8b9f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed
 

‎libraries/ESP32/examples/HWSerial_Events/HWSerial_Events.ino

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@
1212
*
1313
*/
1414

15+
#ifndef ARDUINO_USB_MODE
16+
#error This ESP32 SoC has no Native USB interface
17+
#elif ARDUINO_USB_MODE == 0
18+
#warning This sketch should be used when USB is in Hardware CDC and JTAG mode
19+
void setup(){}
20+
void loop(){}
21+
#else
22+
1523
// USB Event Callback Function that will log CDC events into UART0
1624
static void usbEventCallback(void* arg, esp_event_base_t event_base, int32_t event_id, void* event_data) {
1725
if (event_base == ARDUINO_HW_CDC_EVENTS) {
@@ -58,3 +66,4 @@ void loop() {
5866
while (Serial0.available()) HWCDCSerial.write(Serial0.read());
5967
delay(1000);
6068
}
69+
#endif

0 commit comments

Comments
 (0)
Please sign in to comment.