diff --git a/.github/workflows/LibraryBuild.yml b/.github/workflows/ArduinoBuild.yml similarity index 62% rename from .github/workflows/LibraryBuild.yml rename to .github/workflows/ArduinoBuild.yml index 117b4865..d9b1957e 100644 --- a/.github/workflows/LibraryBuild.yml +++ b/.github/workflows/ArduinoBuild.yml @@ -1,11 +1,11 @@ -name: LibraryBuild +name: ArduinoBuild on: push: paths: - '**.ino' - '**.cpp' - '**.h' - - '**LibraryBuild.yml' + - '**ArduinoBuild.yml' pull_request: release: types: [published] @@ -13,7 +13,7 @@ on: jobs: matrix_build: - name: ${{ matrix.matrix-context }} (${{ matrix.sketch-names }}@${{ matrix.sdk-version }}) + name: ${{ matrix.matrix-context }}@${{ matrix.sdk-version }}) runs-on: ubuntu-latest strategy: @@ -21,59 +21,52 @@ jobs: sdk-version: - 1.0.6 - - 2.0.0 - - 2.0.1 - - 2.0.2 + #- 2.0.0 + #- 2.0.1 + # - 2.0.2 # has broken SD Support + - 2.0.3 + - 2.0.4 matrix-context: - - M5Core2-test - M5Stack-test - M5StickC-test - LGFX-test - M5Unified-test - + - S3Box-Test + #- TTGO-LoRa32-V2-test - M5Stack - M5Core2 - M5Fire - OdroidGo - #- TTGO-LoRa32-V2-test - #exclude: - # - matrix-context: OdroidGo-SD-Menu - # sdk-version: 1.0.6 + exclude: + - sdk-version: 2.0.2 # has broken SD Support + # There's no esp32s3box support before 2.0.3 + - { matrix-context: S3Box-Test, sdk-version: 1.0.6 } + #- { matrix-context: S3Box-Test, sdk-version: 2.0.0 } + #- { matrix-context: S3Box-Test, sdk-version: 2.0.1 } + #- { matrix-context: S3Box-Test sdk-version: 2.0.2 } + - { matrix-context: S3Box-Test, sdk-version: 2.0.4 } # will be fixed in 2.0.5 https://github.com/espressif/arduino-esp32/pull/6962/files + - { matrix-context: M5Core2-test, sdk-version: 1.0.6 } # M5Core2.h suddenly ceased to support 1.0.6 (I2S and I2C broken) + include: + + # buildable sdk versions - sdk-version: 1.0.6 - platform-url: https://phpsecu.re/esp32/packages/package_esp32_esp32-1.0.6_index.json - - sdk-version: 2.0.0 - platform-url: https://phpsecu.re/esp32/packages/package_esp32_esp32-2.0.0_index.json - - sdk-version: 2.0.1 - platform-url: https://phpsecu.re/esp32/packages/package_esp32_esp32-2.0.1_index.json - - sdk-version: 2.0.2 - platform-url: https://phpsecu.re/esp32/packages/package_esp32_esp32-2.0.2_index.json + #- sdk-version: 2.0.0 + #- sdk-version: 2.0.1 + - sdk-version: 2.0.3 + - sdk-version: 2.0.4 # library health test sketches - - matrix-context: M5Core2-test - arduino-board: m5stack-core2 - sketch-names: M5Stack-SDLoader-Snippet.ino - required-libraries: "ESP32-Chimera-Core,LovyanGFX,ArduinoJson" - - matrix-context: M5Stack-test - arduino-board: m5stack-core-esp32 - sketch-names: M5Stack-SDLoader-Snippet.ino - required-libraries: "ESP32-Chimera-Core,LovyanGFX,ArduinoJson" - - matrix-context: M5Unified-test - arduino-board: m5stack-core2 - sketch-names: M5Unified.ino - required-libraries: "M5GFX,M5Unified" - - matrix-context: M5StickC-test - arduino-board: m5stick-c - sketch-names: M5StickC-SPIFFS-Loader-Snippet.ino - required-libraries: "M5StickC" - - matrix-context: LGFX-test - arduino-board: m5stack-core-esp32 - sketch-names: LGFX-SDLoader-Snippet.ino - required-libraries: "LovyanGFX" + - { matrix-context: M5Core2-test, arduino-board: m5stack-core2, sketch-names: M5Core2-SDLoader-Snippet.ino, required-libraries: "M5Core2", ... } + - { matrix-context: M5Stack-test, arduino-board: m5stack-core-esp32, sketch-names: M5Stack-SDLoader-Snippet.ino, required-libraries: "ESP32-Chimera-Core,LovyanGFX", ... } + - { matrix-context: S3Box-Test, arduino-board: esp32s3box, sketch-names: M5Stack-SDLoader-Snippet.ino, required-libraries: "ESP32-Chimera-Core,LovyanGFX", ... } + - { matrix-context: M5Unified-test, arduino-board: m5stack-core2, sketch-names: M5Unified.ino, required-libraries: "M5GFX,M5Unified", ... } + - { matrix-context: M5StickC-test, arduino-board: m5stick-c, sketch-names: M5StickC-SPIFFS-Loader-Snippet.ino, required-libraries: "M5StickC", ... } + - { matrix-context: LGFX-test, arduino-board: m5stack-core-esp32, sketch-names: LGFX-SDLoader-Snippet.ino, required-libraries: "LovyanGFX", ... } # Launcher and Appstore - matrix-context: M5Stack @@ -106,7 +99,6 @@ jobs: #sketch-names: TTGO-test.ino #required-libraries: "ESP32-Chimera-Core,LovyanGFX,ArduinoJson" - fail-fast: false steps: @@ -117,16 +109,19 @@ jobs: - name: ${{ matrix.matrix-context }} uses: ArminJo/arduino-test-compile@v3 with: - platform-url: ${{ matrix.platform-url }} - arduino-board-fqbn: esp32-${{ matrix.sdk-version }}:esp32:${{ matrix.arduino-board}}${{ matrix.extra-fqbn }} + platform-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json + #platform-url: ${{ matrix.platform-url }} + arduino-board-fqbn: esp32:esp32:${{ matrix.arduino-board}}${{ matrix.extra-fqbn }} + arduino-platform: esp32:esp32@${{ matrix.sdk-version }} required-libraries: ${{ matrix.required-libraries }} extra-arduino-lib-install-args: --no-deps # extra-arduino-cli-args: ${{ matrix.extra-arduino-cli-args }} + extra-arduino-cli-args: "--warnings default " # see https://github.com/ArminJo/arduino-test-compile/issues/28 sketch-names: ${{ matrix.sketch-names }} set-build-path: true build-properties: ${{ toJson(matrix.build-properties) }} #debug-install: true - - name: Copy compiled binary + - name: Copy compiled binaries if: startsWith(matrix.sketch-names, 'M5Stack-SD-Menu') run: | cp examples/M5Stack-SD-Menu/build/M5Stack-SD-Menu.ino.bin examples/M5Stack-SD-Menu/build/${{ matrix.launcher-name }}-${{ matrix.sdk-version }}.bin diff --git a/.github/workflows/PlatformioBuild.yml b/.github/workflows/PlatformioBuild.yml new file mode 100644 index 00000000..e951c622 --- /dev/null +++ b/.github/workflows/PlatformioBuild.yml @@ -0,0 +1,99 @@ +name: PlatformIOBuild + +env: + PROJECT_DIR: examples/Test/build_test + BRANCH_NAME: ${{ github.head_ref || github.ref_name }} + +on: + push: + paths: + - '**.ino' + - '**.ini' + - '**.cpp' + - '**.hpp' + - '**.h' + - '**.c' + - '**PlatformioBuild.yml' + pull_request: + workflow_dispatch: + +jobs: + + + build: + name: ${{ matrix.piocontext }}@${{ matrix.platform-version }} + + runs-on: ubuntu-latest + + strategy: + matrix: + + piocontext: + - lgfx + - m5stick-c + - m5stack-core-esp32 + - m5stack-core2 + - m5unified + - s3box + + platform-version: + - 1.0.6 + - 2.0.0 + - 2.0.1 + #- 2.0.2 # has broken SD Support + - 2.0.3 + - 2.0.4 + + exclude: + - { piocontext: s3box, platform-version: 1.0.6 } + - { piocontext: s3box, platform-version: 2.0.0 } + - { piocontext: s3box, platform-version: 2.0.1 } + #- { piocontext: s3box, platform-version: 2.0.2 } + - { piocontext: m5stack-core2, platform-version: 1.0.6 } # M5Core2.h broken I2S support with 1.0.6 + - { piocontext: m5stack-core2, platform-version: 2.0.0 } # M5Core2.h broken I2S support with 2.0.0 + + include: + - piocontext: lgfx + - piocontext: m5stick-c + - piocontext: m5stack-core-esp32 + - piocontext: m5stack-core2 + - piocontext: m5unified + - piocontext: s3box + + fail-fast: false + + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + ref: ${{ github.event.pull_request.head.sha }} + + - name: Cache pip + uses: actions/cache@v2 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + - name: Cache PlatformIO + uses: actions/cache@v2 + with: + path: ~/.platformio + key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }} + - name: Set up Python + uses: actions/setup-python@v2 + + - name: Install PlatformIO + run: | + python -m pip install --upgrade pip + pip install --upgrade platformio + pio update + pio upgrade + + - name: Run PlatformIO + run: | + cd ${{ env.PROJECT_DIR }} + [[ "${{ env.BRANCH_NAME }}" == "master" ]] && rm dev_lib_deps.ini || echo "Develop!" && pio system prune -f + pio lib -e ${{ matrix.piocontext }}@${{ matrix.platform-version }} install --no-save file://$(realpath ../../../) + pio run -e ${{ matrix.piocontext }}@${{ matrix.platform-version }} + diff --git a/README.md b/README.md index 7d5355e2..fb3c65e2 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,10 @@ [![License: MIT](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/tobozo/M5Stack-SD-Updater/blob/master/LICENSE) -[![Build Status](https://travis-ci.com/tobozo/M5Stack-SD-Updater.svg?branch=master)](https://travis-ci.com/github/tobozo/M5Stack-SD-Updater) [![Gitter](https://badges.gitter.im/M5Stack-SD-Updater/community.svg)](https://gitter.im/M5Stack-SD-Updater/community) [![arduino-library-badge](https://www.ardu-badge.com/badge/M5Stack-SD-Updater.svg?)](https://www.ardu-badge.com/M5Stack-SD-Updater) [![PlatformIO Registry](https://badges.registry.platformio.org/packages/tobozo/library/M5Stack-SD-Updater.svg?)](https://registry.platformio.org/packages/libraries/tobozo/M5Stack-SD-Updater) +![Arduino Build](https://github.com/tobozo/M5Stack-SD-Updater/actions/workflows/ArduinoBuild.yml/badge.svg?branch=master) +![Platformio Build](https://github.com/tobozo/M5Stack-SD-Updater/actions/workflows/PlatformioBuild.yml/badge.svg?branch=master) # M5Stack-SD-Updater diff --git a/examples/Test/build_test/dev_lib_deps.ini b/examples/Test/build_test/dev_lib_deps.ini new file mode 100644 index 00000000..d398a332 --- /dev/null +++ b/examples/Test/build_test/dev_lib_deps.ini @@ -0,0 +1,29 @@ +[lib_sdupdater] +lib_deps = M5Stack-SD-Updater + +[lib_lgfx] +lib_deps = + git+https://github.com/lovyan03/LovyanGFX#develop + ${lib_sdupdater.lib_deps} + +[lib_chimeracore] +lib_deps = + git+https://github.com/lovyan03/LovyanGFX#develop + git+https://github.com/tobozo/ESP32-Chimera-Core#1.4.2 + ${lib_sdupdater.lib_deps} + +[lib_m5unified] +lib_deps = + git+https://github.com/M5Stack/M5GFX#develop + git+https://github.com/M5Stack/M5Unified#develop + ${lib_sdupdater.lib_deps} + +[lib_m5core2] +lib_deps = + M5Core2 + ${lib_sdupdater.lib_deps} + +[lib_m5stickc] +lib_deps = + M5StickC + ${lib_sdupdater.lib_deps} diff --git a/examples/Test/build_test/main/main.cpp b/examples/Test/build_test/main/main.cpp new file mode 100644 index 00000000..64013f91 --- /dev/null +++ b/examples/Test/build_test/main/main.cpp @@ -0,0 +1,27 @@ + +#if defined TEST_LGFX + + #include "../../../LGFX-SDLoader-Snippet/LGFX-SDLoader-Snippet.ino" + +#elif defined TEST_M5Core2 + + #include "../../../M5Core2-SDLoader-Snippet/M5Core2-SDLoader-Snippet.ino" + +#elif defined TEST_M5Stack || defined TEST_S3Box + + #include "../../../M5Stack-SDLoader-Snippet/M5Stack-SDLoader-Snippet.ino" + +#elif defined TEST_M5StickC + + #include "../../../M5StickC-SPIFFS-Loader-Snippet/M5StickC-SPIFFS-Loader-Snippet.ino" + +#elif defined TEST_M5Unified + + #include "../../../M5Unified/M5Unified.ino" + +#else + + #error "No device to test" + +#endif + diff --git a/examples/Test/build_test/platformio.ini b/examples/Test/build_test/platformio.ini new file mode 100644 index 00000000..762bd5de --- /dev/null +++ b/examples/Test/build_test/platformio.ini @@ -0,0 +1,188 @@ +[platformio] +default_envs = m5stack-core-esp32 +src_dir = main +extra_configs = dev_lib_deps.ini + + +[env] +framework = arduino +board = m5stack-core-esp32 +build_type = debug +lib_ldf_mode = deep + + +[platform_default] +platform = espressif32 +platform_packages = framework-arduinoespressif32 + +[platform_tasmota] +platform = https://github.com/tasmota/platform-espressif32 + +;[platform_dev] +;platform = https://github.com/platformio/platform-espressif32.git + +[esp32_1_0_6] +platform = espressif32 @ ^3 +;platform_packages = +; toolchain-xtensa32 @ ~2.50200.0 +; framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#1.0.6 + +[esp32_2_0_0] +platform = https://github.com/platformio/platform-espressif32.git#feature/arduino-upstream +platform_packages = + toolchain-xtensa32 @ ~2.80400.0 + framework-arduinoespressif32@https://github.com/espressif/arduino-esp32.git#2.0.0 + +[esp32_2_0_1] +platform = ${platform_tasmota.platform} +platform_packages = framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#2.0.1 + +[esp32_2_0_2] +platform = ${platform_tasmota.platform} +platform_packages = framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#2.0.2 + +[esp32_2_0_3] +platform = espressif32 @ ^4 +platform_packages = framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#2.0.3 + +[esp32_2_0_4] +platform = espressif32 @ ^5 +platform_packages = framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#2.0.4 + + +[lib_sdupdater] +lib_deps = M5Stack-SD-Updater + +[lib_lgfx] +lib_deps = + ${lib_sdupdater.lib_deps} + LovyanGFX + +[lib_chimeracore] +lib_deps = + ${lib_sdupdater.lib_deps} + ESP32-Chimera-Core + +[lib_m5unified] +lib_deps = + ${lib_sdupdater.lib_deps} + M5Unified + +[lib_m5core2] +lib_deps = + ${lib_sdupdater.lib_deps} + M5Core2 + +[lib_m5stickc] +lib_deps = + ${lib_sdupdater.lib_deps} + M5StickC + + + +[lgfx] +extends = lib_lgfx +build_flags = -DTEST_LGFX + +[M5StickC] +extends = lib_m5stickc +board = m5stick-c +build_flags = -DTEST_M5StickC + +[M5Stack] +extends = lib_chimeracore +board = m5stack-core-esp32 +build_flags = -DTEST_M5Stack + +[M5Core2] +extends = lib_m5core2 +board = m5stack-core2 +build_flags = -DTEST_M5Core2 + +[M5Unified] +extends = lib_m5unified +build_flags = -DTEST_M5Unified + +[S3Box] +extends = lib_chimeracore +board = esp32dev +board_build.mcu = esp32s3 +build_flags = -DTEST_S3Box + + +[env:m5stack-core-esp32] +[env:m5stack-core2] +[env:m5stick-c] +[env:m5unified] +[env:lgfx] +[env:s3box] + +[env:m5stack-core-esp32@1.0.6] +extends = esp32_1_0_6, M5Stack +[env:m5stack-core-esp32@2.0.0] +extends = esp32_2_0_0, M5Stack +[env:m5stack-core-esp32@2.0.1] +extends = esp32_2_0_1, M5Stack +[env:m5stack-core-esp32@2.0.2] +extends = esp32_2_0_2, M5Stack +[env:m5stack-core-esp32@2.0.3] +extends = esp32_2_0_3, M5Stack +[env:m5stack-core-esp32@2.0.4] +extends = esp32_2_0_4, M5Stack + +[env:m5stack-core2@1.0.6] +extends = esp32_1_0_6, M5Core2 +[env:m5stack-core2@2.0.0] +extends = esp32_2_0_0, M5Core2 +[env:m5stack-core2@2.0.1] +extends = esp32_2_0_1, M5Core2 +[env:m5stack-core2@2.0.2] +extends = esp32_2_0_2, M5Core2 +[env:m5stack-core2@2.0.3] +extends = esp32_2_0_3, M5Core2 +[env:m5stack-core2@2.0.4] +extends = esp32_2_0_4, M5Core2 + +[env:m5stick-c@1.0.6] +extends = esp32_1_0_6, M5StickC +[env:m5stick-c@2.0.0] +extends = esp32_2_0_0, M5StickC +[env:m5stick-c@2.0.1] +extends = esp32_2_0_1, M5StickC +[env:m5stick-c@2.0.2] +extends = esp32_2_0_2, M5StickC +[env:m5stick-c@2.0.3] +extends = esp32_2_0_3, M5StickC +[env:m5stick-c@2.0.4] +extends = esp32_2_0_4, M5StickC + +[env:m5unified@1.0.6] +extends = esp32_1_0_6, M5Unified +[env:m5unified@2.0.0] +extends = esp32_2_0_0, M5Unified +[env:m5unified@2.0.1] +extends = esp32_2_0_1, M5Unified +[env:m5unified@2.0.2] +extends = esp32_2_0_2, M5Unified +[env:m5unified@2.0.3] +extends = esp32_2_0_3, M5Unified +[env:m5unified@2.0.4] +extends = esp32_2_0_4, M5Unified + +[env:lgfx@1.0.6] +extends = esp32_1_0_6, lgfx +[env:lgfx@2.0.0] +extends = esp32_2_0_0, lgfx +[env:lgfx@2.0.1] +extends = esp32_2_0_1, lgfx +[env:lgfx@2.0.2] +extends = esp32_2_0_2, lgfx +[env:lgfx@2.0.3] +extends = esp32_2_0_3, lgfx +[env:lgfx@2.0.4] +extends = esp32_2_0_3, lgfx + +[env:s3box@2.0.3] +extends = esp32_2_0_3, S3Box +[env:s3box@2.0.4] +extends = esp32_2_0_4, S3Box diff --git a/library.json b/library.json index c2896796..de3a09dc 100644 --- a/library.json +++ b/library.json @@ -10,7 +10,7 @@ "type": "git", "url": "https://github.com/tobozo/M5Stack-SD-Updater.git" }, - "version": "1.2.0", + "version": "1.2.1", "framework": "arduino", "headers": "M5StackUpdater.h", "platforms": "espressif32" diff --git a/library.properties b/library.properties index 29337f46..53bb73a4 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=M5Stack-SD-Updater -version=1.2.0 +version=1.2.1 author=tobozo maintainer=tobozo@noreply.github.com sentence=SD Card Loader for M5 Stack diff --git a/src/M5StackUpdater.cpp b/src/M5StackUpdater.cpp index 4ca2d846..2c818dfe 100644 --- a/src/M5StackUpdater.cpp +++ b/src/M5StackUpdater.cpp @@ -487,7 +487,11 @@ void SDUpdater::checkSDUpdaterUI( String fileName, unsigned long waitdelay ) } if( cfg->onWaitForAction ) { + [[maybe_unused]] unsigned long startwait = millis(); int ret = cfg->onWaitForAction( isRollBack ? (char*)cfg->labelRollback : (char*)cfg->labelMenu, (char*)cfg->labelSkip, (char*)cfg->labelSave, waitdelay ); + [[maybe_unused]] unsigned long actualwaitdelay = millis()-startwait; + log_v("Action '%d' was triggered after %d ms (waidelay=%d)", ret, actualwaitdelay, waitdelay ); + if ( ret == SDU_BTNA_MENU ) { if( isRollBack == false ) { Serial.printf( SDU_LOAD_TPL, fileName.c_str() ); diff --git a/src/M5StackUpdater.h b/src/M5StackUpdater.h index bcec788c..39b133dd 100644 --- a/src/M5StackUpdater.h +++ b/src/M5StackUpdater.h @@ -295,6 +295,10 @@ __attribute__((unused)) static void checkSDUpdater( fs::FS &fs, String fileName //case 14 : log_d("EXT_CPU_RESET");break; // 14, for APP CPU, reseted by PRO CPU //case 15 : log_d("RTCWDT_BROWN_OUT_RESET");break; // 15, Reset when the vdd voltage is not stable case 16 : log_d("RTCWDT_RTC_RESET"); waitdelay=500; break;// 16, RTC Watch dog reset digital core and rtc module + // case 21: log_d("USB_UART_CHIP_RESET"); waitdelay=2000; break;// Various reset reasons for ESP32-S3 + // case 22: log_d("USB_JTAG_CHIP_RESET"); waitdelay=2000; break;// Various reset reasons for ESP32-S3 + // case 24: log_d("JTAG_RESET"); waitdelay=2000; break; // Various reset reasons for ESP32-S3 + default : log_d("NO_MEAN"); waitdelay=100; } } diff --git a/src/M5StackUpdaterConfig.h b/src/M5StackUpdaterConfig.h index 1cd4183b..7e9f1bac 100644 --- a/src/M5StackUpdaterConfig.h +++ b/src/M5StackUpdaterConfig.h @@ -165,8 +165,11 @@ extern "C" { #include #elif defined CONFIG_IDF_TARGET_ESP32C3 #include + #elif defined CONFIG_IDF_TARGET_ESP32S3 + #include #else - #error Target CONFIG_IDF_TARGET is not supported + #warning "Target CONFIG_IDF_TARGET is unknown" + #include #endif #else #include diff --git a/src/M5StackUpdaterUI.h b/src/M5StackUpdaterUI.h index f079cbb5..9694d7f0 100644 --- a/src/M5StackUpdaterUI.h +++ b/src/M5StackUpdaterUI.h @@ -136,6 +136,23 @@ static void SDMenuProgressHeadless( int state, int size ) #endif #endif + #if defined ARDUINO_ESP32_S3_BOX + // this is temporary and may change later + namespace SDU + { + static int lastbtnstate = digitalRead( GPIO_NUM_1 ); + static bool MuteChanged() + { + if( digitalRead( GPIO_NUM_1 ) != lastbtnstate ) { + lastbtnstate = 1-lastbtnstate; + log_d("btnstate: %d", lastbtnstate ); + return true; + } + return false; + } + } + #endif + // theme selector #ifdef ARDUINO_ODROID_ESP32 // Odroid-GO has 4 buttons under the TFT #define BUTTON_WIDTH 60 @@ -359,9 +376,9 @@ static void SDMenuProgressHeadless( int state, int size ) SDUCfg.onBefore(); SDUCfg.onSplashPage( BTN_HINT_MSG ); BtnStyles btns; - SDUCfg.onButtonDraw( labelLoad, 0, btns.Load.BorderColor, btns.Load.FillColor, btns.Load.TextColor, btns.Load.ShadowColor ); - SDUCfg.onButtonDraw( labelSkip, 1, btns.Skip.BorderColor, btns.Skip.FillColor, btns.Skip.TextColor, btns.Skip.ShadowColor ); - if( SDUCfg.binFileName != nullptr ) { + if( SDUCfg.Buttons[0].cb) SDUCfg.onButtonDraw( labelLoad, 0, btns.Load.BorderColor, btns.Load.FillColor, btns.Load.TextColor, btns.Load.ShadowColor ); + if( SDUCfg.Buttons[1].cb) SDUCfg.onButtonDraw( labelSkip, 1, btns.Skip.BorderColor, btns.Skip.FillColor, btns.Skip.TextColor, btns.Skip.ShadowColor ); + if( SDUCfg.binFileName != nullptr && SDUCfg.Buttons[2].cb ) { SDUCfg.onButtonDraw( labelSave, 2, btns.Save.BorderColor, btns.Save.FillColor, btns.Save.TextColor, btns.Save.ShadowColor ); } } @@ -379,7 +396,10 @@ static void SDMenuProgressHeadless( int state, int size ) do { if( SDUCfg.buttonsUpdate ) SDUCfg.buttonsUpdate(); for( int i=0; i<3; i++ ) { - if( SDUCfg.Buttons[i].cb && SDUCfg.Buttons[i].cb() ) { ret = SDUCfg.Buttons[i].val; goto _endAssert; } + if( SDUCfg.Buttons[i].cb && SDUCfg.Buttons[i].cb() ) { + log_v("SDUCfg.Buttons[%d] was triggered", i); + ret = SDUCfg.Buttons[i].val; goto _endAssert; + } } if( SDUCfg.onProgress ) { float barprogress = float(millis() - msec) / float(waitdelay); @@ -480,7 +500,7 @@ static void SDMenuProgressHeadless( int state, int size ) xpos = 0 ; } } - int posX = (SDU_GFX.width() - ProgressStyle.width+2) >> 1; + //int posX = (SDU_GFX.width() - ProgressStyle.width+2) >> 1; int posY = (SDU_GFX.height()- ProgressStyle.height+2) >> 1; SDU_GFX.setCursor( xpos, posY - 20 ); SDU_GFX.print( label ); @@ -520,6 +540,14 @@ static void SDMenuProgressHeadless( int state, int size ) if( !SDUCfg.onAfter ) { SDUCfg.setAfterCb( thawTextStyle ); log_v("Attached onAfter"); } if( !SDUCfg.onSplashPage ) { SDUCfg.setSplashPageCb( drawSDUSplashPage ); log_v("Attached onSplashPage"); } if( !SDUCfg.onButtonDraw ) { SDUCfg.setButtonDrawCb( drawSDUPushButton ); log_v("Attached onButtonDraw"); } + #if defined ARDUINO_ESP32_S3_BOX + SDUCfg.setSDUBtnA( SDU::MuteChanged ); log_v("Attached Mute Read"); + SDUCfg.setSDUBtnB( nullptr ); log_v("Detached BtnB"); + SDUCfg.setSDUBtnC( nullptr ); log_v("Detached BtnC"); + SDUCfg.setLabelSkip( nullptr ); log_v("Disabled Skip"); + SDUCfg.setLabelRollback( nullptr ); log_v("Disabled Rollback"); + SDUCfg.setLabelSave( nullptr ); log_v("Disabled Save"); + #endif #if defined SDU_HAS_TOUCH // default touch button support if ( !SDUCfg.onWaitForAction) { SDUCfg.setWaitForActionCb( assertStartUpdateFromTouchButton ); log_v("Attached onWaitForAction (touch)"); } #else // default momentary button support diff --git a/src/gitTagVersion.h b/src/gitTagVersion.h index c181a03f..01010438 100644 --- a/src/gitTagVersion.h +++ b/src/gitTagVersion.h @@ -1,6 +1,6 @@ #define SDU_VERSION_MAJOR 1 #define SDU_VERSION_MINOR 2 -#define SDU_VERSION_PATCH 0 +#define SDU_VERSION_PATCH 1 #define _SDU_STR(x) #x #define SDU_STR(x) _SDU_STR(x) // Macro to convert library version number into an integer