Skip to content

Commit 36a3a72

Browse files
Merge pull request brettdottech#246 from dreed47/serial_monitor_fixes
Serial monitor fixes
2 parents 03000b8 + b307665 commit 36a3a72

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

firmware/config/config.h.template

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@
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, delay in ms
79+
// #define SERIAL_INTERFACE_INIT_DELAY 4000
80+
7881
// if not defined, then no memory debugging is emitted
7982
// #define MEMORY_DEBUG_INTERVAL 5000
8083

firmware/src/main.cpp

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,24 @@ void addWidgets() {
4646
void setup() {
4747
// Initialize global resources
4848
initializeGlobalResources();
49+
50+
#ifdef SERIAL_INTERFACE_INIT_DELAY
51+
// Add a delay to allow the serial interface to initialize
52+
delay(SERIAL_INTERFACE_INIT_DELAY);
53+
#endif
54+
4955
Serial.begin(115200);
56+
57+
// Clear the serial buffer of any garbage
58+
while (Serial.available() > 0) {
59+
Serial.read();
60+
}
61+
5062
Log.begin(LOG_LEVEL, &Serial);
51-
Log.noticeln("Starting up...");
63+
Log.noticeln("🚀 Starting up...");
5264
Log.noticeln("PCB Version: %s", PCB_VERSION);
5365

66+
5467
wifiManager = new OrbsWiFiManager();
5568
config = new ConfigManager(*wifiManager);
5669
sm = new ScreenManager(tft);

0 commit comments

Comments
 (0)