diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp index ecf9953be..dc3f73d39 100644 --- a/src/graphics/Screen.cpp +++ b/src/graphics/Screen.cpp @@ -703,6 +703,7 @@ void _screen_header() Screen::Screen(uint8_t address, int sda, int scl) : OSThread("Screen"), cmdQueue(32), dispdev(address, sda, scl), ui(&dispdev) { + address_found = address; cmdQueue.setReader(this); } @@ -940,10 +941,12 @@ void Screen::drawDebugInfoWiFiTrampoline(OLEDDisplay *display, OLEDDisplayUiStat * it is expected that this will be used during the boot phase */ void Screen::setSSLFrames() { - // DEBUG_MSG("showing SSL frames\n"); - static FrameCallback sslFrames[] = {drawSSLScreen}; - ui.setFrames(sslFrames, 1); - ui.update(); + if (address_found) { + // DEBUG_MSG("showing SSL frames\n"); + static FrameCallback sslFrames[] = {drawSSLScreen}; + ui.setFrames(sslFrames, 1); + ui.update(); + } } // restore our regular frame list diff --git a/src/graphics/Screen.h b/src/graphics/Screen.h index e4b9044c7..9334fe43c 100644 --- a/src/graphics/Screen.h +++ b/src/graphics/Screen.h @@ -97,6 +97,8 @@ class Screen : public concurrency::OSThread Screen(const Screen &) = delete; Screen &operator=(const Screen &) = delete; + uint8_t address_found; + /// Initializes the UI, turns on the display, starts showing boot screen. // // Not thread safe - must be called before any other methods are called. diff --git a/src/mesh/http/WebServer.cpp b/src/mesh/http/WebServer.cpp index 301b18ccb..d073c16a0 100644 --- a/src/mesh/http/WebServer.cpp +++ b/src/mesh/http/WebServer.cpp @@ -6,6 +6,8 @@ #include #include #include "sleep.h" +#include "graphics/Screen.h" + #include #include @@ -179,9 +181,8 @@ void createSSLCert() yield(); esp_task_wdt_reset(); - if ((millis() / 1000 >= 3) && screen) { - if (screen) - screen->setSSLFrames(); + if (millis() / 1000 >= 3) { + screen->setSSLFrames(); } } runLoop = false;