Line 526: "now - lastRedraw" equates to a negative number and forces the screen into sleep mode
Line 646, 660: if the array size isn't at least the length of the longest name of an effect or palette, then it will not fully print. "Fireworks Starburst" is the longest one at 19 characters. this it kinda a bandaid fix because a longer name may come in the future.
This commit is contained in:
Proto-molecule 2021-12-22 00:43:14 -08:00 committed by GitHub
parent cb4c736fab
commit a841e1fb2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -523,7 +523,7 @@ class FourLineDisplayUsermod : public Usermod {
if (!needRedraw) {
// Nothing to change.
// Turn off display after 1 minutes with no change.
if (sleepMode && !displayTurnedOff && (now - lastRedraw > screenTimeout)) {
if (sleepMode && !displayTurnedOff && (millis() - lastRedraw > screenTimeout)) {
// We will still check if there is a change in redraw()
// and turn it back on if it changed.
sleepOrClock(true);
@ -643,7 +643,7 @@ class FourLineDisplayUsermod : public Usermod {
//Display the current effect or palette (desiredEntry)
// on the appropriate line (row).
void showCurrentEffectOrPalette(int inputEffPal, const char *qstring, uint8_t row) {
char lineBuffer[LINE_BUFFER_SIZE];
char lineBuffer[MAX_JSON_CHARS];
knownMode = effectCurrent;
knownPalette = effectPalette;
if (overlayUntil == 0) {
@ -657,7 +657,7 @@ class FourLineDisplayUsermod : public Usermod {
uint8_t smallChars3 = 0;
// Find the mode name in JSON
printedChars = extractModeName(inputEffPal, qstring, lineBuffer, LINE_BUFFER_SIZE-1);
printedChars = extractModeName(inputEffPal, qstring, lineBuffer, MAX_JSON_CHARS-1);
if (lineHeight == 2) { // use this code for 8 line display
if (printedChars < MAX_MODE_LINE_SPACE) { // use big font if the text fits