Rename Display properties and apply power safe immediatly
This commit is contained in:
parent
e3d2de0319
commit
d1483468c6
@ -18,9 +18,9 @@ public:
|
|||||||
void init(DisplayType_t type, uint8_t data, uint8_t clk, uint8_t cs, uint8_t reset);
|
void init(DisplayType_t type, uint8_t data, uint8_t clk, uint8_t cs, uint8_t reset);
|
||||||
void loop();
|
void loop();
|
||||||
|
|
||||||
bool dispPowerSafe = true;
|
bool enablePowerSafe = true;
|
||||||
bool dispLogo = true;
|
bool showLogo = true;
|
||||||
uint8_t dispContrast = 60;
|
uint8_t contrast = 60;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void printText(const char* text, uint8_t line);
|
void printText(const char* text, uint8_t line);
|
||||||
|
|||||||
@ -134,14 +134,14 @@ void DisplayGraphicClass::loop()
|
|||||||
_display->clearBuffer();
|
_display->clearBuffer();
|
||||||
|
|
||||||
// set Contrast of the Display to raise the lifetime
|
// set Contrast of the Display to raise the lifetime
|
||||||
_display->setContrast(dispContrast);
|
_display->setContrast(contrast);
|
||||||
|
|
||||||
//=====> Logo and Lighting ==========
|
//=====> Logo and Lighting ==========
|
||||||
// pxMovement +x (0 - 6 px)
|
// pxMovement +x (0 - 6 px)
|
||||||
uint8_t ex = (_mExtra % 7);
|
uint8_t ex = (_mExtra % 7);
|
||||||
if (isprod > 0) {
|
if (isprod > 0) {
|
||||||
_display->drawXBMP(5 + ex, 1, 8, 17, bmp_arrow);
|
_display->drawXBMP(5 + ex, 1, 8, 17, bmp_arrow);
|
||||||
if (dispLogo) {
|
if (showLogo) {
|
||||||
_display->drawXBMP(_display->getWidth() - 24 + ex, 2, 16, 16, bmp_logo);
|
_display->drawXBMP(_display->getWidth() - 24 + ex, 2, 16, 16, bmp_logo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -164,8 +164,8 @@ void DisplayGraphicClass::loop()
|
|||||||
else {
|
else {
|
||||||
printText("offline", 1);
|
printText("offline", 1);
|
||||||
// check if it's time to enter power saving mode
|
// check if it's time to enter power saving mode
|
||||||
if (millis() - _previousMillis >= (_interval * 2) && (dispPowerSafe)) {
|
if (millis() - _previousMillis >= (_interval * 2)) {
|
||||||
_display->setPowerSave(true);
|
_display->setPowerSave(enablePowerSafe);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//<=======================
|
//<=======================
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user