Rename Display properties and apply power safe immediatly

This commit is contained in:
Thomas Basler 2023-01-19 22:43:36 +01:00
parent e3d2de0319
commit d1483468c6
2 changed files with 7 additions and 7 deletions

View File

@ -18,9 +18,9 @@ public:
void init(DisplayType_t type, uint8_t data, uint8_t clk, uint8_t cs, uint8_t reset);
void loop();
bool dispPowerSafe = true;
bool dispLogo = true;
uint8_t dispContrast = 60;
bool enablePowerSafe = true;
bool showLogo = true;
uint8_t contrast = 60;
private:
void printText(const char* text, uint8_t line);

View File

@ -134,14 +134,14 @@ void DisplayGraphicClass::loop()
_display->clearBuffer();
// set Contrast of the Display to raise the lifetime
_display->setContrast(dispContrast);
_display->setContrast(contrast);
//=====> Logo and Lighting ==========
// pxMovement +x (0 - 6 px)
uint8_t ex = (_mExtra % 7);
if (isprod > 0) {
_display->drawXBMP(5 + ex, 1, 8, 17, bmp_arrow);
if (dispLogo) {
if (showLogo) {
_display->drawXBMP(_display->getWidth() - 24 + ex, 2, 16, 16, bmp_logo);
}
}
@ -164,8 +164,8 @@ void DisplayGraphicClass::loop()
else {
printText("offline", 1);
// check if it's time to enter power saving mode
if (millis() - _previousMillis >= (_interval * 2) && (dispPowerSafe)) {
_display->setPowerSave(true);
if (millis() - _previousMillis >= (_interval * 2)) {
_display->setPowerSave(enablePowerSafe);
}
}
//<=======================