Infinite logo (#1309)

* Check for button timeout of infinite

* Dedupe

* Alpine bump
This commit is contained in:
Ben V. Brown
2022-06-16 20:21:30 +10:00
committed by GitHub
parent e2eea84e36
commit f5cb42c9d7
3 changed files with 20 additions and 11 deletions

View File

@@ -6,7 +6,7 @@ jobs:
build:
runs-on: ubuntu-20.04
container:
image: alpine:3.15
image: alpine:3.16
strategy:
matrix:
model: ["TS100", "TS80", "TS80P", "Pinecil", "MHP30"]
@@ -57,7 +57,7 @@ jobs:
build_multi-lang:
runs-on: ubuntu-20.04
container:
image: alpine:3.15
image: alpine:3.16
strategy:
matrix:
model: ["Pinecil"]
@@ -107,7 +107,7 @@ jobs:
tests:
runs-on: ubuntu-20.04
container:
image: alpine:3.15
image: alpine:3.16
steps:
- name: deps
@@ -134,7 +134,7 @@ jobs:
check_formatting:
runs-on: ubuntu-20.04
container:
image: alpine:3.15
image: alpine:3.16
steps:
- name: deps

View File

@@ -1,4 +1,4 @@
FROM alpine:3.15
FROM alpine:3.16
LABEL maintainer="Ben V. Brown <ralim@ralimtek.com>"
WORKDIR /build

View File

@@ -4,6 +4,15 @@
#include "OLED.hpp"
#include "cmsis_os.h"
#define LOGO_PAGE_LENGTH 1024
void delay() {
if (getSettingValue(SettingsOptions::LOGOTime) == 5) {
waitForButtonPress();
} else {
waitForButtonPressOrTimeout(TICKS_SECOND * getSettingValue(SettingsOptions::LOGOTime));
}
}
void BootLogo::handleShowingLogo(const uint8_t *ptrLogoArea) {
// Read the first few bytes and figure out what format we are looking at
if (OLD_LOGO_HEADER_VALUE == *(reinterpret_cast<const uint32_t *>(ptrLogoArea))) {
@@ -21,7 +30,7 @@ void BootLogo::showOldFormat(const uint8_t *ptrLogoArea) {
OLED::refresh();
// Delay here until button is pressed or its been the amount of seconds set by the user
waitForButtonPressOrTimeout(TICKS_SECOND * getSettingValue(SettingsOptions::LOGOTime));
delay();
}
void BootLogo::showNewFormat(const uint8_t *ptrLogoArea) {
@@ -46,9 +55,9 @@ void BootLogo::showNewFormat(const uint8_t *ptrLogoArea) {
osDelay(interFrameDelay * 5);
}
// 1024 less the header type byte and the inter-frame-delay
if (getSettingValue(SettingsOptions::LOGOTime) < 5 && (position == 1022 || len == 0)) {
if (getSettingValue(SettingsOptions::LOGOTime) > 0 && (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));
delay();
return;
}
} while (buttons == BUTTON_NONE);