1
0
forked from me/IronOS

Bootup logo settings (#1241)

Adds ability to adjust the time shown for the bootup logo.
This commit is contained in:
discip
2022-04-02 03:39:14 +02:00
committed by GitHub
parent 62dd2abf12
commit 0b8192b690
42 changed files with 750 additions and 1013 deletions

View File

@@ -20,11 +20,14 @@ void BootLogo::showOldFormat(const uint8_t *ptrLogoArea) {
OLED::drawAreaSwapped(0, 0, 96, 16, (uint8_t *)(ptrLogoArea + 4));
OLED::refresh();
// Delay here until button is pressed or its been 4 seconds
waitForButtonPressOrTimeout(TICKS_SECOND * 4);
// Delay here until button is pressed or its been the amount of seconds set by the user
waitForButtonPressOrTimeout(TICKS_SECOND * getSettingValue(SettingsOptions::LOGOTime));
}
void BootLogo::showNewFormat(const uint8_t *ptrLogoArea) {
if (getSettingValue(SettingsOptions::LOGOTime) == 0) {
return;
}
// New logo format (a) fixes long standing byte swap quirk and (b) supports animation
uint8_t interFrameDelay = ptrLogoArea[0];
OLED::clearScreen();
@@ -39,24 +42,16 @@ void BootLogo::showNewFormat(const uint8_t *ptrLogoArea) {
position += len;
buttons = getButtonState();
// Button pressed
if (buttons != BUTTON_NONE) {
return;
}
if (interFrameDelay) {
osDelay(interFrameDelay * 5);
} else {
// Delay here until button is pressed or its been 4 seconds
waitForButtonPressOrTimeout(TICKS_SECOND * 4);
}
// 1024 less the header type byte and the inter-frame-delay
if (getSettingValue(SettingsOptions::LOGOTime) < 5 && (position == 1022 || len == 0)) {
// Delay here until button is pressed or its been the amount of seconds set by the user
waitForButtonPressOrTimeout(TICKS_SECOND * getSettingValue(SettingsOptions::LOGOTime));
return;
}
// If this was an early exit; bail now
if (len == 0) {
return;
}
} while (position < 1022); // 1024 less the header type byte and the inter-frame-delay
} while (buttons == BUTTON_NONE);
}
int BootLogo::showNewFrame(const uint8_t *ptrLogoArea) {
uint8_t length = ptrLogoArea[0];
@@ -81,4 +76,4 @@ int BootLogo::showNewFrame(const uint8_t *ptrLogoArea) {
OLED::refresh();
return (length * 2) + 1;
}
}

View File

@@ -190,6 +190,12 @@ const uint8_t invertDisplayIcon[] = {
0xFE, 0x01, 0x79, 0x25, 0x79, 0x01, 0xFE, 0x00, 0x20, 0x20, 0x20, 0x20, 0xDF, 0x07, 0x8F, 0xDF, 0xFF, 0x01, 0xFE, 0x86, 0xDA, 0x86, 0xFE, 0x01,
0x7F, 0x80, 0xA4, 0xBE, 0xA0, 0x80, 0x7F, 0x00, 0x04, 0x0E, 0x1F, 0x04, 0xFB, 0xFB, 0xFB, 0xFB, 0xFF, 0x80, 0x7F, 0x5B, 0x41, 0x5F, 0x7F, 0x80};
const uint8_t infinityIcon[] = {
// width = 24
// height = 16
0x00, 0xc0, 0x70, 0x18, 0x0c, 0x0c, 0x0c, 0x0c, 0x18, 0x10, 0x20, 0x80, 0xc0, 0x60, 0x30, 0x18, 0x0c, 0x0c, 0x0c, 0x0c, 0x18, 0x70, 0xc0, 0x00,
0x00, 0x01, 0x07, 0x0c, 0x18, 0x18, 0x18, 0x18, 0x0c, 0x06, 0x03, 0x01, 0x00, 0x02, 0x04, 0x0c, 0x18, 0x18, 0x18, 0x18, 0x0c, 0x07, 0x01, 0x00};
/*
* 16x16 icons
* 32 * 3 = Frame size * Frame count