From 7b4fd61a39d02e439711a1b647be80f9ac1dd5e5 Mon Sep 17 00:00:00 2001 From: 0xFEEDC0DE64 Date: Sun, 13 Aug 2023 20:37:50 +0200 Subject: [PATCH] Again so many tft fixes --- main/displays/batterygraphdisplay.cpp | 13 +++++++------ main/displays/batterygraphdisplay.h | 2 +- main/displays/batteryinfodisplay.cpp | 11 ++++++----- main/displays/bmsdisplay.cpp | 4 ++-- main/displays/calibratevoltagedisplay.cpp | 2 +- main/displays/calibratevoltagedisplay.h | 2 +- main/displays/confiscationdisplay.cpp | 12 +++++------- main/displays/confiscationdisplay.h | 2 +- main/displays/gameoflifedisplay.cpp | 12 +++++++----- main/displays/gametrakcalibratedisplay.h | 4 ++-- main/displays/joystickdebugdisplay.cpp | 4 ++-- main/displays/ledstripcolorsdisplay.cpp | 8 +++----- main/displays/ledstripcolorsdisplay.h | 2 +- main/displays/lockscreen.cpp | 2 +- main/displays/menudisplaywithtime.cpp | 8 ++++---- main/displays/menudisplaywithtime.h | 2 +- main/displays/menus/batterymenu.cpp | 6 +++--- main/displays/menus/batterymenu.h | 2 +- main/displays/menus/featureflagsmenu.cpp | 2 +- main/displays/menus/featureflagsmenu.h | 2 +- main/displays/menus/mainmenu.cpp | 2 +- main/displays/menus/mainmenu.h | 2 +- main/displays/metersdisplay.cpp | 4 ++-- main/displays/pingpongdisplay.cpp | 4 ++-- main/displays/potiscalibratedisplay.cpp | 4 ++-- main/displays/powersupplydisplay.cpp | 4 ++-- main/displays/setup/information.cpp | 4 ++-- main/displays/speedinfodisplay.cpp | 4 ++-- main/displays/starfielddisplay.cpp | 4 ++-- main/displays/statusdisplay.cpp | 4 ++-- main/displays/updatedisplay.cpp | 18 +++++++++--------- 31 files changed, 78 insertions(+), 78 deletions(-) diff --git a/main/displays/batterygraphdisplay.cpp b/main/displays/batterygraphdisplay.cpp index 0449ad1..cc91189 100644 --- a/main/displays/batterygraphdisplay.cpp +++ b/main/displays/batterygraphdisplay.cpp @@ -3,6 +3,7 @@ constexpr const char * const TAG = "BatteryGraphDisplay"; // 3rdparty lib includes #include +#include // local includes #include "battery.h" @@ -23,7 +24,7 @@ void BatteryGraphDisplay::initScreen(espgui::TftInterface &tft) drawBatteryCurve(); } -std::string BatteryGraphDisplay::text() const +std::string BatteryGraphDisplay::title() const { if (const auto avgVoltage = controllers.getAvgVoltage(); avgVoltage) { @@ -32,10 +33,10 @@ std::string BatteryGraphDisplay::text() const return TEXT_BATTERY_GRAPH; } -void BatteryGraphDisplay::redraw() +void BatteryGraphDisplay::redraw(espgui::TftInterface &tft) { using namespace espgui; - Base::redraw(); + Base::redraw(TFT); if (const auto avgVoltage = controllers.getAvgVoltage(); avgVoltage) { @@ -49,8 +50,8 @@ void BatteryGraphDisplay::redraw() const uint16_t lastXOffset = onePercent * (100 - getBatteryPercentage(m_lastBatVoltage, cellType)); // clear the old one and draw the new one - tft.fillRect(lastXOffset + 2, TOP_OFFSET, onePercent, tft.height() - TOP_OFFSET, TFT_BLACK); - tft.fillRect(xOffset + 2, TOP_OFFSET, onePercent, tft.height() - TOP_OFFSET, TFT_WHITE); + tft.fillRect(lastXOffset + 2, TOP_OFFSET, onePercent, tft.height() - TOP_OFFSET, espgui::TFT_BLACK); + tft.fillRect(xOffset + 2, TOP_OFFSET, onePercent, tft.height() - TOP_OFFSET, espgui::TFT_WHITE); m_lastBatVoltage = *avgVoltage; drawBatteryCurve(); } @@ -88,7 +89,7 @@ void BatteryGraphDisplay::drawBatteryCurve() const int y1 = float_map(point->minVoltage / 100.f, min_voltage, max_voltage, max_height, TOP_OFFSET); const int x2 = 2 + part * (points - i); const int y2 = float_map(point->maxVoltage / 100.f, min_voltage, max_voltage, max_height, TOP_OFFSET); - tft.drawLine(x1, y1, x2, y2, TFT_WHITE); + tft.drawLine(x1, y1, x2, y2, espgui::TFT_WHITE); } } } diff --git a/main/displays/batterygraphdisplay.h b/main/displays/batterygraphdisplay.h index 38fd226..65600e0 100644 --- a/main/displays/batterygraphdisplay.h +++ b/main/displays/batterygraphdisplay.h @@ -7,7 +7,7 @@ class BatteryGraphDisplay : public BobbyDisplayWithTitle { using Base = BobbyDisplayWithTitle; public: - std::string text() const override; + std::string title() const override; void initScreen(espgui::TftInterface &tft) override; void redraw(espgui::TftInterface &tft) override; diff --git a/main/displays/batteryinfodisplay.cpp b/main/displays/batteryinfodisplay.cpp index 53b6c00..0f528ea 100644 --- a/main/displays/batteryinfodisplay.cpp +++ b/main/displays/batteryinfodisplay.cpp @@ -2,6 +2,7 @@ // 3rdparty lib includes #include +#include // local includes #include "battery.h" @@ -18,15 +19,15 @@ void BatteryInfoDisplay::initScreen(espgui::TftInterface &tft) using namespace espgui; Base::initScreen(tft); - tft.drawRoundRect(m_offset, m_offset, tft.width() - (m_offset * 2), tft.height() - (m_offset * 2), 10, TFT_WHITE); - tft.drawRoundRect((tft.width() / 2) - (m_offset / 2), m_offset / 2, m_offset, m_offset / 2, 3, TFT_WHITE); + tft.drawRoundRect(m_offset, m_offset, tft.width() - (m_offset * 2), tft.height() - (m_offset * 2), 10, espgui::TFT_WHITE); + tft.drawRoundRect((tft.width() / 2) - (m_offset / 2), m_offset / 2, m_offset, m_offset / 2, 3, espgui::TFT_WHITE); m_lastBarCount = 0; } -void BatteryInfoDisplay::redraw() +void BatteryInfoDisplay::redraw(espgui::TftInterface &tft) { using namespace espgui; - Base::redraw(); + Base::redraw(tft); // calculate height of space available for all bars const auto min_x = m_offset + 3; // leave 2 pixels + 1 pixel for border @@ -50,7 +51,7 @@ void BatteryInfoDisplay::redraw() for (auto i = 0; i < 10; ++i) { const auto y = bottomY - (i * segment_height) - segment_height; - tft.fillRoundRect(min_x, y, width, segment_height - 2, 10, segment_count > i ? TFT_GREEN : TFT_DARKGREY); + tft.fillRoundRect(min_x, y, width, segment_height - 2, 10, segment_count > i ? espgui::TFT_GREEN : espgui::TFT_DARKGREY); } } } diff --git a/main/displays/bmsdisplay.cpp b/main/displays/bmsdisplay.cpp index 645033c..98e34b7 100644 --- a/main/displays/bmsdisplay.cpp +++ b/main/displays/bmsdisplay.cpp @@ -42,9 +42,9 @@ void BmsDisplay::initScreen(espgui::TftInterface &tft) m_cycleLabel.start(); } -void BmsDisplay::redraw() +void BmsDisplay::redraw(espgui::TftInterface &tft) { - Base::redraw(); + Base::redraw(tft); if (bluetoothSerial.hasClient()) tft.setTextColor(TFT_GREEN, TFT_BLACK); diff --git a/main/displays/calibratevoltagedisplay.cpp b/main/displays/calibratevoltagedisplay.cpp index abe673e..2629683 100644 --- a/main/displays/calibratevoltagedisplay.cpp +++ b/main/displays/calibratevoltagedisplay.cpp @@ -134,7 +134,7 @@ CalibrateVoltageDisplay::CalibrateVoltageDisplay() constructMenuItem, ResetCalibrationAction>>(); } -std::string CalibrateVoltageDisplay::text() const +std::string CalibrateVoltageDisplay::title() const { return TEXT_BATTERY_CALIBRATE; } diff --git a/main/displays/calibratevoltagedisplay.h b/main/displays/calibratevoltagedisplay.h index 1efa967..f7ece61 100644 --- a/main/displays/calibratevoltagedisplay.h +++ b/main/displays/calibratevoltagedisplay.h @@ -8,7 +8,7 @@ class CalibrateVoltageDisplay : public BobbyMenuDisplay public: CalibrateVoltageDisplay(); - std::string text() const override; + std::string title() const override; void back() override; }; diff --git a/main/displays/confiscationdisplay.cpp b/main/displays/confiscationdisplay.cpp index 8099a7d..42dd7c1 100644 --- a/main/displays/confiscationdisplay.cpp +++ b/main/displays/confiscationdisplay.cpp @@ -32,13 +32,11 @@ void ConfiscationDisplay::initScreen(espgui::TftInterface &tft) { Base::initScreen(tft); - tft.setSwapBytes(true); tft.pushImage(10, 70, bobbyicons::shortcircuit.WIDTH, bobbyicons::shortcircuit.HEIGHT, bobbyicons::shortcircuit.buffer); - tft.setSwapBytes(false); - m_progressBar.start(); + m_progressBar.start(tft); - m_label.start(); + m_label.start(tft); tft.setTextColor(TFT_WHITE, TFT_BLACK); tft.setTextFont(2); @@ -51,9 +49,9 @@ void ConfiscationDisplay::initScreen(espgui::TftInterface &tft) tft.drawString(fmt::format("der Batterie eingeleitet (ca {:.2f}MJ)", calculateMegaJoules()), 10, y+=lineheight); } -void ConfiscationDisplay::redraw() +void ConfiscationDisplay::redraw(espgui::TftInterface &tft) { - Base::redraw(); + Base::redraw(tft); m_progressBar.redraw(m_progress); @@ -109,7 +107,7 @@ void ConfiscationDisplay::buttonPressed(espgui::Button button) } } -std::string ConfiscationDisplay::text() const +std::string ConfiscationDisplay::title() const { return "Explosions-Modus"; } diff --git a/main/displays/confiscationdisplay.h b/main/displays/confiscationdisplay.h index c6bfc40..afef221 100644 --- a/main/displays/confiscationdisplay.h +++ b/main/displays/confiscationdisplay.h @@ -23,7 +23,7 @@ public: void buttonPressed(espgui::Button button) override; - std::string text() const override; + std::string title() const override; private: espgui::ProgressBar m_progressBar{10, 210, 200, 10, 0, 500}; diff --git a/main/displays/gameoflifedisplay.cpp b/main/displays/gameoflifedisplay.cpp index 1481276..0115f13 100644 --- a/main/displays/gameoflifedisplay.cpp +++ b/main/displays/gameoflifedisplay.cpp @@ -4,6 +4,8 @@ #include #include #include +#include +#include // local includes #include "screens.h" @@ -23,16 +25,16 @@ void GameOfLifeDisplay::initScreen(espgui::TftInterface &tft) disableScreenFlip(true); tft.setRotation(3); - tft.fillScreen(TFT_BLACK); + tft.fillScreen(espgui::TFT_BLACK); } -void GameOfLifeDisplay::redraw() +void GameOfLifeDisplay::redraw(espgui::TftInterface &tft) { - Base::redraw(); + Base::redraw(tft); if (gen == 0) { - tft.fillScreen(TFT_BLACK); + tft.fillScreen(espgui::TFT_BLACK); initGrid(); } @@ -71,7 +73,7 @@ void GameOfLifeDisplay::buttonPressed(espgui::Button button) void GameOfLifeDisplay::drawGrid() { - uint16_t color = TFT_WHITE; + uint16_t color = espgui::TFT_WHITE; for (int16_t x = 1; x < GRIDX - 1; x++) { for (int16_t y = 1; y < GRIDY - 1; y++) { if (((*m_grid)[index(x,y)]) != ((*m_newgrid)[index(x,y)])) { diff --git a/main/displays/gametrakcalibratedisplay.h b/main/displays/gametrakcalibratedisplay.h index 98b4de9..7f56093 100644 --- a/main/displays/gametrakcalibratedisplay.h +++ b/main/displays/gametrakcalibratedisplay.h @@ -62,9 +62,9 @@ void GametrakCalibrateDisplay::initScreen(espgui::TftInterface &tft) progressBar.start(); } -void GametrakCalibrateDisplay::redraw() +void GametrakCalibrateDisplay::redraw(espgui::TftInterface &tft) { - Base::redraw(); + Base::redraw(tft); m_labels[0].redraw(fmt::format("{:.02f}", gametrakX)); m_labels[1].redraw(std::to_string(raw_gametrakX)); diff --git a/main/displays/joystickdebugdisplay.cpp b/main/displays/joystickdebugdisplay.cpp index c0c49e1..18f1c89 100644 --- a/main/displays/joystickdebugdisplay.cpp +++ b/main/displays/joystickdebugdisplay.cpp @@ -48,9 +48,9 @@ void JoystickDebugDisplay::update() m_y = map_analog_stick(m_bremsMitte, m_bremsMin, m_bremsMax, configs.deadband.value(), *raw_brems); } -void JoystickDebugDisplay::redraw() +void JoystickDebugDisplay::redraw(espgui::TftInterface &tft) { - Base::redraw(); + Base::redraw(tft); if (m_x && m_y) { diff --git a/main/displays/ledstripcolorsdisplay.cpp b/main/displays/ledstripcolorsdisplay.cpp index dd27224..882a48e 100644 --- a/main/displays/ledstripcolorsdisplay.cpp +++ b/main/displays/ledstripcolorsdisplay.cpp @@ -48,7 +48,7 @@ const std::array tft_colors = { }; } // namespace -std::string LedstripColorsDisplay::text() const +std::string LedstripColorsDisplay::title() const { return TEXT_LEDSTRIPCOLORMENU; } @@ -57,14 +57,12 @@ void LedstripColorsDisplay::initScreen(espgui::TftInterface &tft) { Base::initScreen(tft); - tft.setSwapBytes(true); tft.pushImage(70, 60, bobbyicons::bobbycar.WIDTH, bobbyicons::bobbycar.HEIGHT, bobbyicons::bobbycar.buffer); - tft.setSwapBytes(false); } -void LedstripColorsDisplay::redraw() +void LedstripColorsDisplay::redraw(espgui::TftInterface &tft) { - Base::redraw(); + Base::redraw(tft); auto y_pos = ((tft.width() - 40) / 8 + 4) + 240; if (last_state != state_select_color) diff --git a/main/displays/ledstripcolorsdisplay.h b/main/displays/ledstripcolorsdisplay.h index 40a79bf..9f4cf18 100644 --- a/main/displays/ledstripcolorsdisplay.h +++ b/main/displays/ledstripcolorsdisplay.h @@ -15,7 +15,7 @@ class LedstripColorsDisplay : public BobbyDisplayWithTitle using Base = BobbyDisplayWithTitle; public: - std::string text() const override; + std::string title() const override; void initScreen(espgui::TftInterface &tft) override; void redraw(espgui::TftInterface &tft) override; diff --git a/main/displays/lockscreen.cpp b/main/displays/lockscreen.cpp index 15e107c..ce73d00 100644 --- a/main/displays/lockscreen.cpp +++ b/main/displays/lockscreen.cpp @@ -76,7 +76,7 @@ void Lockscreen::initScreen(espgui::TftInterface &tft) } for (auto &label : m_labels) - label.start(); + label.start(tft); tft.setTextFont(7); diff --git a/main/displays/menudisplaywithtime.cpp b/main/displays/menudisplaywithtime.cpp index 8476605..b17ccd5 100644 --- a/main/displays/menudisplaywithtime.cpp +++ b/main/displays/menudisplaywithtime.cpp @@ -9,17 +9,17 @@ using namespace espgui; namespace bobbygui { -void MenuDisplayWithTime::start() +void MenuDisplayWithTime::initScreen(espgui::TftInterface &tft) { - Base::start(); - m_label_currentTime.start(); + Base::initScreen(tft); + m_label_currentTime.start(tft); } void MenuDisplayWithTime::redraw(espgui::TftInterface &tft) { Base::redraw(tft); tft.setTextFont(use_big_font() ? 4 : 2); - m_label_currentTime.redraw(fmt::format("&7Time: {}", local_clock_string())); + m_label_currentTime.redraw(tft, fontRenderer, fmt::format("&7Time: {}", local_clock_string())); } } // namespace diff --git a/main/displays/menudisplaywithtime.h b/main/displays/menudisplaywithtime.h index 127e826..a54d813 100644 --- a/main/displays/menudisplaywithtime.h +++ b/main/displays/menudisplaywithtime.h @@ -10,7 +10,7 @@ class MenuDisplayWithTime : using Base = BobbyMenuDisplay; public: - void start() override; + void initScreen(espgui::TftInterface &tft) override; void redraw(espgui::TftInterface &tft) override; espgui::Label m_label_currentTime{145, 6}; diff --git a/main/displays/menus/batterymenu.cpp b/main/displays/menus/batterymenu.cpp index 7201522..1ea0997 100644 --- a/main/displays/menus/batterymenu.cpp +++ b/main/displays/menus/batterymenu.cpp @@ -91,7 +91,7 @@ BatteryMenu::BatteryMenu() constructMenuItem, PopScreenAction, StaticMenuItemIcon<&espgui::icons::back>>>(); } -std::string BatteryMenu::text() const +std::string BatteryMenu::title() const { return TEXT_BATTERY; } @@ -109,9 +109,9 @@ void BatteryMenu::start() m_doubleProgressBarBatPercentage.start(); } -void BatteryMenu::redraw() +void BatteryMenu::redraw(espgui::TftInterface &tft) { - Base::redraw(); + Base::redraw(tft); if (const auto avgVoltage = controllers.getAvgVoltage(); avgVoltage) { diff --git a/main/displays/menus/batterymenu.h b/main/displays/menus/batterymenu.h index fc22055..9a08e5f 100644 --- a/main/displays/menus/batterymenu.h +++ b/main/displays/menus/batterymenu.h @@ -12,7 +12,7 @@ class BatteryMenu : public BobbyMenuDisplay public: BatteryMenu(); - std::string text() const override; + std::string title() const override; void initScreen(espgui::TftInterface &tft) override; void start() override; diff --git a/main/displays/menus/featureflagsmenu.cpp b/main/displays/menus/featureflagsmenu.cpp index 20cef1e..dc57ac9 100644 --- a/main/displays/menus/featureflagsmenu.cpp +++ b/main/displays/menus/featureflagsmenu.cpp @@ -113,7 +113,7 @@ void FeatureFlagsMenu::start() isDirty = false; } -std::string FeatureFlagsMenu::text() const +std::string FeatureFlagsMenu::title() const { return TEXT_FEATUREFLAGS; } diff --git a/main/displays/menus/featureflagsmenu.h b/main/displays/menus/featureflagsmenu.h index 89497d0..3225d53 100644 --- a/main/displays/menus/featureflagsmenu.h +++ b/main/displays/menus/featureflagsmenu.h @@ -10,7 +10,7 @@ public: FeatureFlagsMenu(); void start() override; - std::string text() const override; + std::string title() const override; void back() override; }; diff --git a/main/displays/menus/mainmenu.cpp b/main/displays/menus/mainmenu.cpp index abbac47..39f669a 100644 --- a/main/displays/menus/mainmenu.cpp +++ b/main/displays/menus/mainmenu.cpp @@ -124,7 +124,7 @@ MainMenu::MainMenu() //#endif } -std::string MainMenu::text() const +std::string MainMenu::title() const { return TEXT_MAINMENU; } diff --git a/main/displays/menus/mainmenu.h b/main/displays/menus/mainmenu.h index 4d2ce98..86b9eb7 100644 --- a/main/displays/menus/mainmenu.h +++ b/main/displays/menus/mainmenu.h @@ -27,7 +27,7 @@ class MainMenu : public bobbygui::MenuDisplayWithTime public: MainMenu(); - std::string text() const override; + std::string title() const override; void back() override; }; diff --git a/main/displays/metersdisplay.cpp b/main/displays/metersdisplay.cpp index 8b69270..bd39daf 100644 --- a/main/displays/metersdisplay.cpp +++ b/main/displays/metersdisplay.cpp @@ -29,9 +29,9 @@ void MetersDisplay::initScreen(espgui::TftInterface &tft) meter.start(); } -void MetersDisplay::redraw() +void MetersDisplay::redraw(espgui::TftInterface &tft) { - Base::redraw(); + Base::redraw(tft); m_vuMeter.redraw(avgSpeedKmh); diff --git a/main/displays/pingpongdisplay.cpp b/main/displays/pingpongdisplay.cpp index 6d2a036..4feb06d 100644 --- a/main/displays/pingpongdisplay.cpp +++ b/main/displays/pingpongdisplay.cpp @@ -29,9 +29,9 @@ void PingPongDisplay::initScreen(espgui::TftInterface &tft) midline(); } -void PingPongDisplay::redraw() +void PingPongDisplay::redraw(espgui::TftInterface &tft) { - Base::redraw(); + Base::redraw(tft); lpaddle(); rpaddle(); diff --git a/main/displays/potiscalibratedisplay.cpp b/main/displays/potiscalibratedisplay.cpp index 7f0db13..63919d1 100644 --- a/main/displays/potiscalibratedisplay.cpp +++ b/main/displays/potiscalibratedisplay.cpp @@ -66,9 +66,9 @@ void PotisCalibrateDisplay::update() m_brems = std::nullopt; } -void PotisCalibrateDisplay::redraw() +void PotisCalibrateDisplay::redraw(espgui::TftInterface &tft) { - Base::redraw(); + Base::redraw(tft); m_labels[0].redraw(m_gas ? fmt::format("{:.02f}", *m_gas) : "?"); m_labels[1].redraw(raw_gas ? std::to_string(*raw_gas) : "?"); diff --git a/main/displays/powersupplydisplay.cpp b/main/displays/powersupplydisplay.cpp index bf3bc05..d5876a9 100644 --- a/main/displays/powersupplydisplay.cpp +++ b/main/displays/powersupplydisplay.cpp @@ -22,9 +22,9 @@ void PowerSupplyDisplay::initScreen(espgui::TftInterface &tft) m_currentLabel.start(); } -void PowerSupplyDisplay::redraw() +void PowerSupplyDisplay::redraw(espgui::TftInterface &tft) { - Base::redraw(); + Base::redraw(tft); m_voltageLabel.redraw(std::to_string(50.4) + 'V'); m_currentLabel.redraw(std::to_string(15.1) + 'A'); diff --git a/main/displays/setup/information.cpp b/main/displays/setup/information.cpp index bb173cc..a564263 100644 --- a/main/displays/setup/information.cpp +++ b/main/displays/setup/information.cpp @@ -42,11 +42,11 @@ void SetupInformationDisplay::update() Base::update(); } -void SetupInformationDisplay::redraw() +void SetupInformationDisplay::redraw(espgui::TftInterface &tft) { m_init_text_progressbar.redraw(espchrono::ago(m_menu_opened_timestamp) / 50ms); - Base::redraw(); + Base::redraw(tft); } void SetupInformationDisplay::buttonPressed(espgui::Button button) diff --git a/main/displays/speedinfodisplay.cpp b/main/displays/speedinfodisplay.cpp index cdb6e76..0c9207b 100644 --- a/main/displays/speedinfodisplay.cpp +++ b/main/displays/speedinfodisplay.cpp @@ -25,11 +25,11 @@ void SpeedInfoDisplay::initScreen(espgui::TftInterface &tft) m_currentPowerLabel.start(); } -void SpeedInfoDisplay::redraw() +void SpeedInfoDisplay::redraw(espgui::TftInterface &tft) { using namespace espgui; - Base::redraw(); + Base::redraw(tft); tft.setTextColor(TFT_WHITE, TFT_BLACK); tft.setTextFont(4); diff --git a/main/displays/starfielddisplay.cpp b/main/displays/starfielddisplay.cpp index 3c4e279..4b74943 100644 --- a/main/displays/starfielddisplay.cpp +++ b/main/displays/starfielddisplay.cpp @@ -33,9 +33,9 @@ void StarfieldDisplay::initScreen(espgui::TftInterface &tft) //tft.fastSetup(); // Prepare plot window range for fast pixel plotting } -void StarfieldDisplay::redraw() +void StarfieldDisplay::redraw(espgui::TftInterface &tft) { - Base::redraw(); + Base::redraw(tft); uint8_t spawnDepthVariation = 255; diff --git a/main/displays/statusdisplay.cpp b/main/displays/statusdisplay.cpp index 8aa147b..cc32b42 100644 --- a/main/displays/statusdisplay.cpp +++ b/main/displays/statusdisplay.cpp @@ -73,9 +73,9 @@ void StatusDisplay::initScreen(espgui::TftInterface &tft) tft.setTextColor(TFT_WHITE, TFT_BLACK); } -void StatusDisplay::redraw() +void StatusDisplay::redraw(espgui::TftInterface &tft) { - Base::redraw(); + Base::redraw(tft); { const auto now = espchrono::millis_clock::now(); diff --git a/main/displays/updatedisplay.cpp b/main/displays/updatedisplay.cpp index bcbafd7..2110c13 100644 --- a/main/displays/updatedisplay.cpp +++ b/main/displays/updatedisplay.cpp @@ -19,7 +19,7 @@ void UpdateDisplay::initScreen(espgui::TftInterface &tft) { - Base::initScreen(espgui::TftInterface &tft); + Base::initScreen(tft); tft.setTextFont(4); tft.setTextColor(TFT_YELLOW); @@ -31,17 +31,17 @@ void UpdateDisplay::initScreen(espgui::TftInterface &tft) tft.setTextColor(TFT_WHITE, TFT_BLACK); tft.drawString("Status:", 20, m_statusLabel.y()); - m_statusLabel.start(); + m_statusLabel.start(tft); tft.drawString("Progress:", 20, m_progressLabel.y()); - m_progressLabel.start(); + m_progressLabel.start(tft); tft.drawString("Total:", 20, m_totalLabel.y()); - m_totalLabel.start(); + m_totalLabel.start(tft); - m_messageLabel.start(); + m_messageLabel.start(tft); - m_progressBar.start(); + m_progressBar.start(tft); if (const esp_app_desc_t *app_desc = esp_ota_get_app_description()) { @@ -50,12 +50,12 @@ void UpdateDisplay::initScreen(espgui::TftInterface &tft) tft.setTextColor(TFT_WHITE, TFT_BLACK); } - m_newVersionLabel.start(); + m_newVersionLabel.start(tft); } -void UpdateDisplay::redraw() +void UpdateDisplay::redraw(espgui::TftInterface &tft) { - Base::redraw(); + Base::redraw(tft); if (asyncOta) {