From 364d81e9063757b8bde4d2f6e1f696f37e5bf048 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Sat, 2 Apr 2022 16:02:26 +0200 Subject: [PATCH] adjust for serial wait time during nRF52 bootup --- src/graphics/Screen.cpp | 3 ++- src/main.cpp | 4 ++++ src/main.h | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp index cf6b26c39..e30367f5b 100644 --- a/src/graphics/Screen.cpp +++ b/src/graphics/Screen.cpp @@ -854,8 +854,9 @@ int32_t Screen::runOnce() } // Show boot screen for first 3 seconds, then switch to normal operation. + // serialSinceMsec adjusts for additional serial wait time during nRF52 bootup static bool showingBootScreen = true; - if (showingBootScreen && (millis() > 5000)) { + if (showingBootScreen && (millis() > (5000 + serialSinceMsec))) { DEBUG_MSG("Done with boot screen...\n"); stopBootScreen(); showingBootScreen = false; diff --git a/src/main.cpp b/src/main.cpp index d90bce00d..5a7887608 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -78,6 +78,8 @@ uint8_t cardkb_found; // The I2C address of the Faces Keyboard (if found) uint8_t faceskb_found; +uint32_t serialSinceMsec; + bool axp192_found; Router *router = NULL; // Users of router don't care what sort of subclass implements that API @@ -141,6 +143,8 @@ void setup() consoleInit(); // Set serial baud rate and init our mesh console } #endif + + serialSinceMsec = millis(); DEBUG_MSG("\n\n//\\ E S H T /\\ S T / C\n\n"); diff --git a/src/main.h b/src/main.h index c5fc62f32..21138d3f0 100644 --- a/src/main.h +++ b/src/main.h @@ -30,6 +30,8 @@ extern uint32_t timeLastPowered; extern uint32_t rebootAtMsec; extern uint32_t shutdownAtMsec; +extern uint32_t serialSinceMsec; + // If a thread does something that might need for it to be rescheduled ASAP it can set this flag // This will supress the current delay and instead try to run ASAP. extern bool runASAP;