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: build:
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
container: container:
image: alpine:3.15 image: alpine:3.16
strategy: strategy:
matrix: matrix:
model: ["TS100", "TS80", "TS80P", "Pinecil", "MHP30"] model: ["TS100", "TS80", "TS80P", "Pinecil", "MHP30"]
@@ -22,7 +22,7 @@ jobs:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
with: with:
submodules: true submodules: true
- name: Git ownership exception - name: Git ownership exception
run: git config --global --add safe.directory /__w/IronOS/IronOS && git config --global safe.directory "$GITHUB_WORKSPACE" 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: build_multi-lang:
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
container: container:
image: alpine:3.15 image: alpine:3.16
strategy: strategy:
matrix: matrix:
model: ["Pinecil"] model: ["Pinecil"]
@@ -72,10 +72,10 @@ jobs:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
with: with:
submodules: true submodules: true
- name: Git ownership exception - name: Git ownership exception
run: git config --global --add safe.directory /__w/IronOS/IronOS && git config --global safe.directory "$GITHUB_WORKSPACE" run: git config --global --add safe.directory /__w/IronOS/IronOS && git config --global safe.directory "$GITHUB_WORKSPACE"
- name: build ${{ matrix.model }} - 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 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: tests:
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
container: container:
image: alpine:3.15 image: alpine:3.16
steps: steps:
- name: deps - name: deps
@@ -134,7 +134,7 @@ jobs:
check_formatting: check_formatting:
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
container: container:
image: alpine:3.15 image: alpine:3.16
steps: steps:
- name: deps - name: deps

View File

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

View File

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