Test if screen address was found

1.2-legacy
Jm Casler 2021-12-18 11:02:54 -05:00
rodzic d1370071da
commit f3fc88ac5d
3 zmienionych plików z 13 dodań i 7 usunięć

Wyświetl plik

@ -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

Wyświetl plik

@ -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.

Wyświetl plik

@ -6,6 +6,8 @@
#include <HTTPMultipartBodyParser.hpp>
#include <HTTPURLEncodedBodyParser.hpp>
#include "sleep.h"
#include "graphics/Screen.h"
#include <WebServer.h>
#include <WiFi.h>
@ -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;