From f5cb42c9d74e4ce4646fa9e0496411b72eb4c48f Mon Sep 17 00:00:00 2001 From: "Ben V. Brown" <5425387+Ralim@users.noreply.github.com> Date: Thu, 16 Jun 2022 20:21:30 +1000 Subject: [PATCH] Infinite logo (#1309) * Check for button timeout of infinite * Dedupe * Alpine bump --- .github/workflows/push.yml | 14 +++++++------- Dockerfile | 2 +- source/Core/Drivers/BootLogo.cpp | 15 ++++++++++++--- 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 9c1eb85b..5720a006 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -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"] @@ -22,7 +22,7 @@ jobs: - uses: actions/checkout@v3 with: submodules: true - + - name: Git ownership exception run: git config --global --add safe.directory /__w/IronOS/IronOS && git config --global safe.directory "$GITHUB_WORKSPACE" @@ -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"] @@ -72,10 +72,10 @@ jobs: - uses: actions/checkout@v3 with: submodules: true - + - name: Git ownership exception run: git config --global --add safe.directory /__w/IronOS/IronOS && git config --global safe.directory "$GITHUB_WORKSPACE" - + - name: build ${{ matrix.model }} run: cd source && make -j$(nproc) model="${{ matrix.model }}" firmware-multi_compressed_European firmware-multi_compressed_Bulgarian+Russian+Serbian+Ukrainian firmware-multi_Chinese+Japanese @@ -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 diff --git a/Dockerfile b/Dockerfile index 4622f33b..b1351a5a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM alpine:3.15 +FROM alpine:3.16 LABEL maintainer="Ben V. Brown " WORKDIR /build diff --git a/source/Core/Drivers/BootLogo.cpp b/source/Core/Drivers/BootLogo.cpp index 37b38eba..5113fadb 100644 --- a/source/Core/Drivers/BootLogo.cpp +++ b/source/Core/Drivers/BootLogo.cpp @@ -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(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);