From a841e1fb2e5ffc33ff85dac5f27be5e94cb71174 Mon Sep 17 00:00:00 2001 From: Proto-molecule <89719460+Proto-molecule@users.noreply.github.com> Date: Wed, 22 Dec 2021 00:43:14 -0800 Subject: [PATCH 1/2] bugs 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. --- .../usermod_v2_four_line_display_ALT.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usermods/usermod_v2_four_line_display_ALT/usermod_v2_four_line_display_ALT.h b/usermods/usermod_v2_four_line_display_ALT/usermod_v2_four_line_display_ALT.h index 02f590e5f..c8d235c96 100644 --- a/usermods/usermod_v2_four_line_display_ALT/usermod_v2_four_line_display_ALT.h +++ b/usermods/usermod_v2_four_line_display_ALT/usermod_v2_four_line_display_ALT.h @@ -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 From 599490bb6e454cdc47c64a18c35d7c0438897c7e Mon Sep 17 00:00:00 2001 From: Proto-molecule <89719460+Proto-molecule@users.noreply.github.com> Date: Wed, 22 Dec 2021 01:18:29 -0800 Subject: [PATCH 2/2] bugs line 436: perhaps this needs to be 256? --- .../usermod_v2_rotary_encoder_ui_ALT.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usermods/usermod_v2_rotary_encoder_ui_ALT/usermod_v2_rotary_encoder_ui_ALT.h b/usermods/usermod_v2_rotary_encoder_ui_ALT/usermod_v2_rotary_encoder_ui_ALT.h index 9174f35b9..dcf62464e 100644 --- a/usermods/usermod_v2_rotary_encoder_ui_ALT/usermod_v2_rotary_encoder_ui_ALT.h +++ b/usermods/usermod_v2_rotary_encoder_ui_ALT/usermod_v2_rotary_encoder_ui_ALT.h @@ -433,7 +433,7 @@ public: #endif if (increase) { if (currentHue1<256) currentHue1 += 4; else currentHue1 = 0; } else { if (currentHue1>3) currentHue1 -= 4; else currentHue1 = 256; } - colorHStoRGB(currentHue1*255, currentSat1, col); + colorHStoRGB(currentHue1*256, currentSat1, col); strip.applyToAllSelected = true; strip.setColor(0, colorFromRgbw(col)); lampUdated();