Bugfixes.
This commit is contained in:
parent
518e1a6405
commit
853463b7cd
@ -490,19 +490,20 @@ class FourLineDisplayUsermod : public Usermod {
|
|||||||
} else if ((bri == 0 && powerON) || (bri > 0 && !powerON)) { //trigger power icon
|
} else if ((bri == 0 && powerON) || (bri > 0 && !powerON)) { //trigger power icon
|
||||||
powerON = !powerON;
|
powerON = !powerON;
|
||||||
drawStatusIcons();
|
drawStatusIcons();
|
||||||
updateBrightness();
|
|
||||||
lastRedraw = millis();
|
|
||||||
return;
|
return;
|
||||||
} else if (knownnightlight != nightlightActive) { //trigger moon icon
|
} else if (knownnightlight != nightlightActive) { //trigger moon icon
|
||||||
knownnightlight = nightlightActive;
|
knownnightlight = nightlightActive;
|
||||||
drawStatusIcons();
|
drawStatusIcons();
|
||||||
if (knownnightlight) overlay(PSTR(" Timer On"), 3000, 6);
|
if (knownnightlight) {
|
||||||
lastRedraw = millis();
|
String timer = PSTR("Timer On");
|
||||||
|
center(timer,LINE_BUFFER_SIZE-1);
|
||||||
|
overlay(timer.c_str(), 3000, 6);
|
||||||
|
lastRedraw = millis();
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
} else if (wificonnected != interfacesInited) { //trigger wifi icon
|
} else if (wificonnected != interfacesInited) { //trigger wifi icon
|
||||||
wificonnected = interfacesInited;
|
wificonnected = interfacesInited;
|
||||||
drawStatusIcons();
|
drawStatusIcons();
|
||||||
lastRedraw = millis();
|
|
||||||
return;
|
return;
|
||||||
} else if (knownMode != effectCurrent) {
|
} else if (knownMode != effectCurrent) {
|
||||||
knownMode = effectCurrent;
|
knownMode = effectCurrent;
|
||||||
@ -708,33 +709,56 @@ class FourLineDisplayUsermod : public Usermod {
|
|||||||
clear();
|
clear();
|
||||||
// Turn the display back on
|
// Turn the display back on
|
||||||
sleepOrClock(false);
|
sleepOrClock(false);
|
||||||
|
lastRedraw = millis();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Allows you to show one line and a glyph as overlay for a
|
* Allows you to show one line and a glyph as overlay for a period of time.
|
||||||
* period of time.
|
|
||||||
* Clears the screen and prints.
|
* Clears the screen and prints.
|
||||||
|
* Used in Rotary Encoder usermod.
|
||||||
*/
|
*/
|
||||||
void overlay(const char* line1, long showHowLong, byte glyphType) {
|
void overlay(const char* line1, long showHowLong, byte glyphType) {
|
||||||
// Turn the display back on
|
// Turn the display back on
|
||||||
wakeDisplay();
|
if (!wakeDisplay()) clear();
|
||||||
// Print the overlay
|
// Print the overlay
|
||||||
if (glyphType > 0) {
|
if (glyphType > 0) {
|
||||||
if (lineHeight == 2) drawGlyph(5, 0, glyphType, u8x8_font_benji_custom_icons_6x6, true);
|
if (lineHeight == 2) drawGlyph(5, 0, glyphType, u8x8_font_benji_custom_icons_6x6, true);
|
||||||
else drawGlyph(7, lineHeight, glyphType, u8x8_font_benji_custom_icons_2x2, true);
|
else drawGlyph(7, lineHeight, glyphType, u8x8_font_benji_custom_icons_2x2, true);
|
||||||
if (line1) drawString(0, 3*lineHeight, line1);
|
if (line1) drawString(0, 3*lineHeight, line1);
|
||||||
} else {
|
} else {
|
||||||
if (line1) drawString(0, 2*(lineHeight-1), line1);
|
if (line1) drawString(0, lineHeight, line1);
|
||||||
|
}
|
||||||
|
overlayUntil = millis() + showHowLong;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allows you to show two lines as overlay for a period of time.
|
||||||
|
* Clears the screen and prints.
|
||||||
|
* Used in Auto Save usermod
|
||||||
|
*/
|
||||||
|
void overlay(const char* line1, const char* line2, long showHowLong) {
|
||||||
|
// Turn the display back on
|
||||||
|
if (!wakeDisplay()) clear();
|
||||||
|
// Print the overlay
|
||||||
|
if (line1) {
|
||||||
|
String buf = line1;
|
||||||
|
center(buf, getCols());
|
||||||
|
drawString(0, 1*lineHeight, buf.c_str());
|
||||||
|
}
|
||||||
|
if (line2) {
|
||||||
|
String buf = line2;
|
||||||
|
center(buf, getCols());
|
||||||
|
drawString(0, 2*lineHeight, buf.c_str());
|
||||||
}
|
}
|
||||||
overlayUntil = millis() + showHowLong;
|
overlayUntil = millis() + showHowLong;
|
||||||
}
|
}
|
||||||
|
|
||||||
void networkOverlay(const char* line1, long showHowLong) {
|
void networkOverlay(const char* line1, long showHowLong) {
|
||||||
// Turn the display back on
|
// Turn the display back on
|
||||||
wakeDisplay();
|
if (!wakeDisplay()) clear();
|
||||||
// Print the overlay
|
// Print the overlay
|
||||||
if (line1) {
|
if (line1) {
|
||||||
String l1 = line1;
|
String l1 = line1;
|
||||||
|
@ -468,6 +468,7 @@ public:
|
|||||||
if (display != nullptr) {
|
if (display != nullptr) {
|
||||||
if (display->wakeDisplay()) {
|
if (display->wakeDisplay()) {
|
||||||
// Throw away wake up input
|
// Throw away wake up input
|
||||||
|
display->redraw(true);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
String line = stateName;
|
String line = stateName;
|
||||||
@ -491,6 +492,7 @@ public:
|
|||||||
void changeBrightness(bool increase) {
|
void changeBrightness(bool increase) {
|
||||||
#ifdef USERMOD_FOUR_LINE_DISPLAY
|
#ifdef USERMOD_FOUR_LINE_DISPLAY
|
||||||
if (display && display->wakeDisplay()) {
|
if (display && display->wakeDisplay()) {
|
||||||
|
display->redraw(true);
|
||||||
// Throw away wake up input
|
// Throw away wake up input
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -507,6 +509,7 @@ public:
|
|||||||
void changeEffect(bool increase) {
|
void changeEffect(bool increase) {
|
||||||
#ifdef USERMOD_FOUR_LINE_DISPLAY
|
#ifdef USERMOD_FOUR_LINE_DISPLAY
|
||||||
if (display && display->wakeDisplay()) {
|
if (display && display->wakeDisplay()) {
|
||||||
|
display->redraw(true);
|
||||||
// Throw away wake up input
|
// Throw away wake up input
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -523,6 +526,7 @@ public:
|
|||||||
void changeEffectSpeed(bool increase) {
|
void changeEffectSpeed(bool increase) {
|
||||||
#ifdef USERMOD_FOUR_LINE_DISPLAY
|
#ifdef USERMOD_FOUR_LINE_DISPLAY
|
||||||
if (display && display->wakeDisplay()) {
|
if (display && display->wakeDisplay()) {
|
||||||
|
display->redraw(true);
|
||||||
// Throw away wake up input
|
// Throw away wake up input
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -538,6 +542,7 @@ public:
|
|||||||
void changeEffectIntensity(bool increase) {
|
void changeEffectIntensity(bool increase) {
|
||||||
#ifdef USERMOD_FOUR_LINE_DISPLAY
|
#ifdef USERMOD_FOUR_LINE_DISPLAY
|
||||||
if (display && display->wakeDisplay()) {
|
if (display && display->wakeDisplay()) {
|
||||||
|
display->redraw(true);
|
||||||
// Throw away wake up input
|
// Throw away wake up input
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -553,6 +558,7 @@ public:
|
|||||||
void changePalette(bool increase) {
|
void changePalette(bool increase) {
|
||||||
#ifdef USERMOD_FOUR_LINE_DISPLAY
|
#ifdef USERMOD_FOUR_LINE_DISPLAY
|
||||||
if (display && display->wakeDisplay()) {
|
if (display && display->wakeDisplay()) {
|
||||||
|
display->redraw(true);
|
||||||
// Throw away wake up input
|
// Throw away wake up input
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user