Boot logo.

This commit is contained in:
Blaž Kristan 2022-01-05 10:40:26 +01:00
parent 8b10ec93c2
commit 002b2d0134
3 changed files with 25 additions and 33 deletions

View File

@ -137,9 +137,6 @@ class FourLineDisplayUsermod : public Usermod {
bool showSeconds = true; // display clock with seconds bool showSeconds = true; // display clock with seconds
bool enabled = true; bool enabled = true;
// needRedraw marks if redraw is required to prevent often redrawing.
//bool needRedraw = true;
// Next variables hold the previous known values to determine if redraw is // Next variables hold the previous known values to determine if redraw is
// required. // required.
String knownSsid = ""; String knownSsid = "";
@ -261,7 +258,7 @@ class FourLineDisplayUsermod : public Usermod {
setContrast(contrast); //Contrast setup will help to preserve OLED lifetime. In case OLED need to be brighter increase number up to 255 setContrast(contrast); //Contrast setup will help to preserve OLED lifetime. In case OLED need to be brighter increase number up to 255
setPowerSave(0); setPowerSave(0);
//drawString(0, 0, "Loading..."); //drawString(0, 0, "Loading...");
overlayLogo(PSTR("Loading..."),3000,1); overlayLogo(3000);
} }
// gets called every time WiFi is (re-)connected. Initialize own network // gets called every time WiFi is (re-)connected. Initialize own network
@ -608,26 +605,21 @@ class FourLineDisplayUsermod : public Usermod {
} }
overlayUntil = millis() + showHowLong; overlayUntil = millis() + showHowLong;
} }
/** /**
* Allows you to show one line and a glyph as overlay for a period of time. * Allows you to show Akemi WLED logo overlay for a period of time.
* Clears the screen and prints. * Clears the screen and prints.
* Used in Rotary Encoder usermod.
*/ */
void overlayLogo(const char* line1, long showHowLong, byte glyphType) { void overlayLogo(long showHowLong) {
// Turn the display back on // Turn the display back on
if (!wakeDisplay()) clear(); if (!wakeDisplay()) clear();
// Print the overlay // Print the overlay
if (glyphType>0 && glyphType<255) { if (lineHeight == 2) {
if (lineHeight == 2){ drawGlyph(2, 1, 1, u8x8_WLED_logo_4x4, true); drawGlyph( 2, 1, 1, u8x8_WLED_logo_4x4, true);
drawGlyph( 6, 1, 2, u8x8_WLED_logo_4x4, true); drawGlyph( 6, 1, 2, u8x8_WLED_logo_4x4, true);
drawGlyph(10, 1, 3, u8x8_WLED_logo_4x4, true); drawGlyph(10, 1, 3, u8x8_WLED_logo_4x4, true);
}else drawGlyph(7, lineHeight, glyphType, u8x8_4LineDisplay_WLED_icons_2x2, true); } else
} drawGlyph( 2, 0, 1, u8x8_WLED_logo_4x12);
if (line1) {
String buf = line1;
center(buf, getCols());
drawString(0, (glyphType<255?3:0)*lineHeight, buf.c_str());
}
overlayUntil = millis() + showHowLong; overlayUntil = millis() + showHowLong;
} }

View File

@ -369,7 +369,7 @@ public:
case 4: changedState = changeState(PSTR("Effect"), 3, 0, 5); break; //5 = puzzle piece case 4: changedState = changeState(PSTR("Effect"), 3, 0, 5); break; //5 = puzzle piece
case 5: changedState = changeState(PSTR("Main Color"), 255, 255, 7); break; //7 = brush case 5: changedState = changeState(PSTR("Main Color"), 255, 255, 7); break; //7 = brush
case 6: changedState = changeState(PSTR("Saturation"), 255, 255, 8); break; //8 = contrast case 6: changedState = changeState(PSTR("Saturation"), 255, 255, 8); break; //8 = contrast
case 7: changedState = changeState(PSTR("Preset"), 255, 255, 6); break; //6 = moon case 7: changedState = changeState(PSTR("Preset"), 255, 255, 11); break; //11 = heart
} }
} }
if (changedState) select_state = newState; if (changedState) select_state = newState;