Implement optional looping for animated boot logo [#1839]

This commit is contained in:
Ivan Zorin
2023-11-21 01:38:10 +03:00
parent e3bad2adae
commit a02f8c8ae3
5 changed files with 60 additions and 31 deletions

View File

@@ -86,7 +86,7 @@ static const SettingConstants settingsConstants[(int)SettingsOptions::SettingsOp
{0, 50, 1, 20}, // PDNegTimeout
{0, 1, 1, 0}, // OLEDInversion
{MIN_BRIGHTNESS, MAX_BRIGHTNESS, BRIGHTNESS_STEP, DEFAULT_BRIGHTNESS}, // OLEDBrightness
{0, 5, 1, 1}, // LOGOTime
{0, 6, 1, 1}, // LOGOTime
{0, 1, 1, 0}, // CalibrateCJC
{0, 1, 1, 1}, // BluetoothLE
{0, 1, 1, 1}, // PDVpdo

View File

@@ -837,13 +837,20 @@ static void displayInvertColor(void) {
}
static void displayLogoTime(void) {
if (getSettingValue(SettingsOptions::LOGOTime) == 0) {
switch (getSettingValue(SettingsOptions::LOGOTime)) {
case logoMode_t::SKIP:
OLED::print(translatedString(Tr->OffString), FontStyle::LARGE);
} else if (getSettingValue(SettingsOptions::LOGOTime) == 5) {
break;
case logoMode_t::ONETIME:
OLED::printNumber(1, 3, FontStyle::LARGE);
break;
case logoMode_t::INFINITY:
OLED::drawArea(OLED_WIDTH - 24 - 2, 0, 24, 16, infinityIcon);
} else {
break;
default:
OLED::printNumber(getSettingValue(SettingsOptions::LOGOTime), 2, FontStyle::LARGE);
OLED::print(LargeSymbolSeconds, FontStyle::LARGE);
break;
}
}