From f7fb9a2bd6640b7eadbef74b3eb508ae8af94687 Mon Sep 17 00:00:00 2001 From: Thomas Basler Date: Thu, 19 Jan 2023 23:10:41 +0100 Subject: [PATCH] Display: Add property to enable or disable the screensaver --- include/Display_Graphic.h | 1 + src/Display_Graphic.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/Display_Graphic.h b/include/Display_Graphic.h index 591e73b..13f6c62 100644 --- a/include/Display_Graphic.h +++ b/include/Display_Graphic.h @@ -19,6 +19,7 @@ public: void loop(); bool enablePowerSafe = true; + bool enableScreensaver = true; bool showLogo = true; uint8_t contrast = 60; diff --git a/src/Display_Graphic.cpp b/src/Display_Graphic.cpp index 4b32a5d..aa192b9 100644 --- a/src/Display_Graphic.cpp +++ b/src/Display_Graphic.cpp @@ -61,7 +61,7 @@ void DisplayGraphicClass::printText(const char* text, uint8_t line) uint16_t maxHeight = _display->getHeight(); // pxMovement +x (0 - 6 px) - uint8_t ex = (_mExtra % 7); + uint8_t ex = enableScreensaver ? (_mExtra % 7) : 0; // set the font size based on the display size switch (line) { @@ -138,7 +138,7 @@ void DisplayGraphicClass::loop() //=====> Logo and Lighting ========== // pxMovement +x (0 - 6 px) - uint8_t ex = (_mExtra % 7); + uint8_t ex = enableScreensaver ? (_mExtra % 7) : 0; if (isprod > 0) { _display->drawXBMP(5 + ex, 1, 8, 17, bmp_arrow); if (showLogo) {