Skip to content

Commit

Permalink
Fix: No OpenDTU startup of CDC (like Pico or ESP32-S3) devices if no …
Browse files Browse the repository at this point in the history
…usb host is connected

Should also fix #826
  • Loading branch information
tbnobody committed May 3, 2023
1 parent 7c80fe2 commit 65b728e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -213,4 +213,5 @@ build_flags = ${env.build_flags}
-DCMT_GPIO2=3
-DCMT_GPIO3=8
-DCMT_SDIO=5
-DARDUINO_USB_MODE=1
-DARDUINO_USB_MODE=1
-DARDUINO_USB_CDC_ON_BOOT=1
5 changes: 5 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,13 @@ void setup()
{
// Initialize serial output
Serial.begin(SERIAL_BAUDRATE);
#if ARDUINO_USB_CDC_ON_BOOT
Serial.setTxTimeoutMs(0);
delay(100);
#else
while (!Serial)
yield();
#endif
MessageOutput.println();
MessageOutput.println("Starting OpenDTU");

Expand Down

0 comments on commit 65b728e

Please sign in to comment.