mirror of
https://github.com/btclock/btclock_v3.git
synced 2024-11-19 02:40:01 +01:00
Add "storage mode" to protect EPDs (lowest button while booting)
This commit is contained in:
parent
37c57b7d97
commit
23ef2a64cc
@ -31,6 +31,16 @@ void setup()
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
if (mcp1.digitalRead(0) == LOW)
|
||||
{
|
||||
// Then loop forever to prevent anything else from writing to the screen
|
||||
while (true) {
|
||||
delay(1000);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tryImprovSetup();
|
||||
|
||||
setupWebserver();
|
||||
|
@ -155,7 +155,19 @@ void setupDisplays()
|
||||
11, &tasks[i]); // create task
|
||||
}
|
||||
|
||||
epdContent = {"B", "T", "C", "L", "O", "C", "K"};
|
||||
// Hold lower button to enable "storage mode" (prevents burn-in of ePaper displays)
|
||||
if (mcp1.digitalRead(0) == LOW)
|
||||
{
|
||||
setFgColor(GxEPD_BLACK);
|
||||
setBgColor(GxEPD_WHITE);
|
||||
|
||||
epdContent = {" ", " ", " ", " ", " ", " ", " "};
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
epdContent = {"B", "T", "C", "L", "O", "C", "K"};
|
||||
}
|
||||
|
||||
setEpdContent(epdContent);
|
||||
}
|
||||
@ -244,10 +256,9 @@ void prepareDisplayUpdateTask(void *pvParameters)
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
showDigit(epdIndex, epdContent[epdIndex].c_str()[0], updatePartial,
|
||||
&FONT_BIG);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -402,9 +413,9 @@ void showDigit(const uint dispNum, char chr, bool partial,
|
||||
displays[dispNum].setCursor(x, y);
|
||||
displays[dispNum].print(str);
|
||||
|
||||
if (chr == '.')
|
||||
if (chr == '.')
|
||||
{
|
||||
displays[dispNum].fillRect(x,y,displays[dispNum].width(),round(displays[dispNum].height() * 0.9), getBgColor());
|
||||
displays[dispNum].fillRect(x, y, displays[dispNum].width(), round(displays[dispNum].height() * 0.9), getBgColor());
|
||||
}
|
||||
|
||||
// displays[dispNum].setCursor(10, 3);
|
||||
|
Loading…
Reference in New Issue
Block a user