Bootup logo settings (#1241)
Adds ability to adjust the time shown for the bootup logo.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user