Skip to content

Commit f945433

Browse files
committed
moved the clearing code and used the SERIAL_INTERFACE_INIT_DELAY value to set the delay
1 parent 147b39c commit f945433

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

firmware/config/config.h.template

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@
7575
// LOG_LEVEL_WARNING, LOG_LEVEL_NOTICE, LOG_LEVEL_VERBOSE
7676
#define LOG_LEVEL LOG_LEVEL_VERBOSE
7777

78-
// Enable if you're having issues with the app outputting garbage characters on startup
79-
// #define SERIAL_INTERFACE_INIT_DELAY
78+
// Enable if you're having issues with the app outputting garbage characters on startup, delay in ms
79+
// #define SERIAL_INTERFACE_INIT_DELAY 4000
8080

8181
// ============= END OF USER CONFIGURATION =================================================================
8282

firmware/src/main.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,16 @@ void setup() {
4949

5050
#ifdef SERIAL_INTERFACE_INIT_DELAY
5151
// Add a delay to allow the serial interface to initialize
52-
delay(4000);
52+
delay(SERIAL_INTERFACE_INIT_DELAY);
5353
#endif
5454

55+
Serial.begin(115200);
56+
5557
// Clear the serial buffer of any garbage
5658
while (Serial.available() > 0) {
5759
Serial.read();
5860
}
5961

60-
Serial.begin(115200);
6162
Log.begin(LOG_LEVEL, &Serial);
6263
Log.noticeln("🚀 Starting up...");
6364

0 commit comments

Comments
 (0)