Skip to content

Commit

Permalink
Merge pull request #181 from tobozo/1.2.5
Browse files Browse the repository at this point in the history
1.2.5
  • Loading branch information
tobozo authored May 3, 2023
2 parents 011a3db + d21cd5e commit 62170f8
Show file tree
Hide file tree
Showing 25 changed files with 273 additions and 179 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/ArduinoBuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,26 +84,26 @@ jobs:
sketch-names: M5Stack-SD-Menu.ino,AppStore.ino
launcher-name: M5stack-Launcher
appstore-name: M5stack-AppStore
required-libraries: "ESP32-Chimera-Core,LovyanGFX,ArduinoJson,ESP32-targz"
required-libraries: "ESP32-Chimera-Core,LovyanGFX,ArduinoJson"
- matrix-context: M5Core2
arduino-board: m5stack-core2
sketch-names: M5Stack-SD-Menu.ino,AppStore.ino
launcher-name: M5Core2-Launcher
appstore-name: M5Core2-AppStore
required-libraries: "ESP32-Chimera-Core,LovyanGFX,ArduinoJson,ESP32-targz"
required-libraries: "ESP32-Chimera-Core,LovyanGFX,ArduinoJson"
- matrix-context: M5Fire
arduino-board: m5stack-fire
sketch-names: M5Stack-SD-Menu.ino,AppStore.ino
launcher-name: M5Fire-Launcher
appstore-name: M5Fire-AppStore
required-libraries: "ESP32-Chimera-Core,LovyanGFX,ArduinoJson,ESP32-targz"
required-libraries: "ESP32-Chimera-Core,LovyanGFX,ArduinoJson"
- matrix-context: OdroidGo
arduino-board: odroid_esp32
sketch-names: M5Stack-SD-Menu.ino,AppStore.ino
launcher-name: OdroidGo-Launcher
appstore-name: OdroidGo-AppStore
extra-fqbn: ":PartitionScheme=min_spiffs"
required-libraries: "ESP32-Chimera-Core,LovyanGFX,ArduinoJson,ESP32-targz,Button2"
required-libraries: "ESP32-Chimera-Core,LovyanGFX,ArduinoJson,Button2"
#- matrix-context: TTGO-LoRa32-V2-test
#arduino-board: ttgo-lora32-v2
#sketch-names: TTGO-test.ino
Expand All @@ -113,7 +113,7 @@ jobs:
arduino-board: m5stack-atom
sketch-names: M5Stack-SD-Menu.ino
launcher-name: M5Atom-Launcher
required-libraries: "ESP32-Chimera-Core,LovyanGFX,ArduinoJson,ESP32-targz,Button2"
required-libraries: "ESP32-Chimera-Core,LovyanGFX,ArduinoJson,Button2"

fail-fast: false

Expand All @@ -129,7 +129,7 @@ jobs:
#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 }}
required-libraries: ESP32-targz,${{ 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
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/PlatformioBuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ jobs:
- piocontext: m5stack-core2
- piocontext: m5unified
- piocontext: s3box
- { platform-version: 2.0.8, piocontext: sdfat-test }

fail-fast: false

Expand Down Expand Up @@ -101,6 +102,6 @@ jobs:
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 pkg install -e ${{ matrix.piocontext }}@${{ matrix.platform-version }} --no-save --library file://$(realpath ../../../)
pio run -e ${{ matrix.piocontext }}@${{ matrix.platform-version }}
3 changes: 2 additions & 1 deletion examples/Headless/Headless.ino
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#define SDU_APP_NAME "Headless Example"
#define SDU_APP_PATH "/Headless_Example.bin"
#define SDU_HEADLESS // don't load gfx clutter (but implement my own action trigger)
#define SDU_NO_AUTODETECT // don't load gfx clutter (but implement my own action trigger)
#define TFCARD_CS_PIN 4 // this is needed by SD.begin()
#include <SD.h> // /!\ headless mode skips autodetect and may require to include the filesystem library **before** the M5StackUpdater library
#include <ESP32-targz.h> // optional: https://github.com/tobozo/ESP32-targz
#include <M5StackUpdater.h>


Expand Down
1 change: 1 addition & 0 deletions examples/LGFX-SDLoader-Snippet/LGFX-SDLoader-Snippet.ino
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ static LGFX tft;
// #define _MOSI 3

#define SDU_APP_NAME "LGFX Loader Snippet"
#include <ESP32-targz.h> // optional: https://github.com/tobozo/ESP32-targz
#include <M5StackUpdater.h>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include <M5Core2.h>
#define SDU_APP_NAME "M5Core2 SDLoader Snippet"
#include <ESP32-targz.h> // optional: https://github.com/tobozo/ESP32-targz
#include <M5StackUpdater.h>

void setup()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
*/
#include <M5Stack.h>
#include <LittleFS.h>

#include <ESP32-targz.h> // optional: https://github.com/tobozo/ESP32-targz

#define SDU_APP_NAME "M5Stack SDLoader Snippet"
#define SDU_APP_PATH "/MY_SKETCH.bin"
Expand Down
2 changes: 1 addition & 1 deletion examples/M5Stack-SD-Menu/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include <SD.h>
#include <ESP32-Chimera-Core.h> // use LGFX display autodetect
#include <ESP32-targz.h> // support gzipped applications
#include <ESP32-targz.h> // optional: https://github.com/tobozo/ESP32-targz

#define SDU_APP_NAME "Application Launcher"
#include <M5StackUpdater.h> // https://github.com/tobozo/M5Stack-SD-Updater
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
#include <ESP32-Chimera-Core.h> // any other ESP32 device with SD
#endif
*/
#include <ESP32-targz.h> // optional: https://github.com/tobozo/ESP32-targz
#include <ESP32-Chimera-Core.h>
//#include <M5Stack.h>
// #define SDU_HEADLESS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
* flash back the menu.bin into memory.
*
*/
#include <ESP32-targz.h> // optional: https://github.com/tobozo/ESP32-targz
#include <M5StickC.h>
#include <M5StackUpdater.h>

Expand Down
3 changes: 2 additions & 1 deletion examples/M5Unified/M5Unified.ino
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@

#include <SD.h>
#include <M5Unified.h>
//#define TFCARD_CS_PIN 4
#define SDUPDATER_AUTODETECT
#include <ESP32-targz.h> // optional: https://github.com/tobozo/ESP32-targz
#include <M5StackUpdater.h>

void setup(void)
Expand Down
64 changes: 51 additions & 13 deletions examples/SdFatUpdater/SdFatUpdater.ino
Original file line number Diff line number Diff line change
@@ -1,22 +1,60 @@
#define TFCARD_CS_PIN 4 // customize this

#include <M5Unified.h> // /!\ When using SdFat, always include LGFX/M5GFX *before* M5StackUpdater.h to prevent problems with macros

#include <M5Unified.h> // Note: don't mix M5Unified with LovyanGFX
//#include <M5Core2.h>
//#include <M5Stack.h>
//#define LGFX_AUTODETECT
//#include <LovyanGFX.h>


// M5StackUpdater library configuration

#define SDU_NO_PRAGMAS // don't spawn pragma messages during compilation
#define SDU_ENABLE_GZ // auto-load ESP32-targz (will be loaded otherwise is previously included)
//#include <ESP32-targz.h> // optional gzipped firmware support, overriden by SDU_ENABLE_GZ -> https://github.com/tobozo/ESP32-targz
#define SDU_NO_AUTODETECT // Disable SDUpdater autodetect: this prevents <SD.h> to be auto-selected, however it also disables board detection
#define USE_SDFATFS // Tell M5StackUpdater to load <SdFat.h> and wrap SdFat32 into fs::FS::SdFat32FSImpl
#define SDU_APP_NAME "SdFatUpdater test"
#define SDU_APP_PATH "/SdFatUpdater.bin"

#define HAS_M5_API // Use M5 API (M5.BtnA, BtnB, BtnC...) for triggers
#define SDU_USE_DISPLAY // Enable display (progress bar, lobby, buttons)
#define HAS_LGFX // Use LGFX Family display driver with zoom, rotate
#define SDU_Sprite LGFX_Sprite // Inherit Sprite type from M5GFX
#define SDU_DISPLAY_TYPE M5GFX* // inherit display type from M5GFX
#define SDU_DISPLAY_OBJ_PTR &M5.Display // alias display pointer from M5Unified
#define SDU_TouchButton LGFX_Button // inherit Buttons types from M5Unified
#if !defined SDU_HAS_TOUCH && defined ARDUINO_M5STACK_Core2
#define SDU_HAS_TOUCH
#endif
#if __has_include(<LovyanGFX.h>)
LGFX lcd;
#define HAS_M5_API // Use M5 API (M5.BtnA, BtnB, BtnC...) for triggers
#define SDU_USE_DISPLAY // Enable display (progress bar, lobby, b
#define HAS_LGFX // Use LGFX Family display driver with zo
#define SDU_Sprite LGFX_Sprite // Inherit Sprite type from LGFX
#define SDU_DISPLAY_TYPE LGFX* // inherit display type from LGFX
#define SDU_DISPLAY_OBJ_PTR &lcd // alias display pointer from lcd object
#elif __has_include(<M5Unified.h>)
#define HAS_M5_API // Use M5 API (M5.BtnA, BtnB, BtnC...) for triggers
#define SDU_USE_DISPLAY // Enable display (progress bar, lobby, buttons)
#define HAS_LGFX // Use LGFX Family display driver with zoom, rotate
#define SDU_Sprite LGFX_Sprite // Inherit Sprite type from M5GFX
#define SDU_DISPLAY_TYPE M5GFX* // inherit display type from M5GFX
#define SDU_DISPLAY_OBJ_PTR &M5.Display // alias display pointer from M5Unified
#if defined ARDUINO_M5STACK_Core2
#define SDU_TouchButton LGFX_Button // inherit Buttons types from M5Unified
#define SDU_HAS_TOUCH
#endif
#elif __has_include(<M5Core2.h>) || __has_include(<M5Stack.h>)
#define HAS_M5_API // Use M5 API (M5.BtnA, BtnB, BtnC...) for triggers
#define SDU_USE_DISPLAY // Enable display (progress bar, lobby, buttons)
#define SDU_Sprite TFT_eSprite // Inherit TFT_eSprite type from M5 Core
#define SDU_DISPLAY_TYPE M5Display* // inherit TFT_eSpi type from M5 Core
#define SDU_DISPLAY_OBJ_PTR &M5.Lcd // alias display pointer from M5 Core
#if defined ARDUINO_M5STACK_Core2 && __has_include(<M5Core2.h>)
#define SDU_TouchButton TFT_eSPI_Button // inherit Buttons types from TFT_eSPI
#define SDU_HAS_TOUCH
#endif

#else

#error "This example only supports the following cores: LovyanGFX.h, M5Unified.h, M5Stack.h or M5Core2.h"

#endif

//#include <SdFat.h> // not necessary when `USE_SDFATFS` is defined
#include <M5StackUpdater.h>

SdFs sd;
Expand All @@ -31,8 +69,8 @@ void setup()
SDUCfg.setLabelMenu("< Menu"); // BtnA label: load menu.bin
SDUCfg.setLabelSkip("Launch"); // BtnB label: skip the lobby countdown and run the app
SDUCfg.setLabelSave("Save"); // BtnC label: save the sketch to the SD
SDUCfg.setAppName("SdFatUpdater test"); // lobby screen label: application name
SDUCfg.setBinFileName("/SdFatUpdater.bin"); // if file path to bin is set for this app, it will be checked at boot and created if not exist
SDUCfg.setAppName( SDU_APP_NAME ); // lobby screen label: application name
SDUCfg.setBinFileName( SDU_APP_PATH ); // if file path to bin is set for this app, it will be checked at boot and created if not exist

checkSDUpdater(
sd, // filesystem (must be type SdFat32)
Expand Down
16 changes: 15 additions & 1 deletion examples/Test/build_test/dev_lib_deps.ini
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
[lib_sdupdater]
lib_deps =
M5Stack-SD-Updater
tobozo/ESP32-targz
ESP32-targz

[lib_lgfx]
lib_deps =
SD
git+https://github.com/lovyan03/LovyanGFX#develop
${lib_sdupdater.lib_deps}
build_flags =
${env.build_flags}
-D LGFX_AUTODETECT
-D LGFX_USE_V1
lib_ldf_mode = deep

[lib_chimeracore]
lib_deps =
Expand All @@ -16,6 +22,7 @@ lib_deps =

[lib_m5unified]
lib_deps =
SD
git+https://github.com/M5Stack/M5GFX#develop
git+https://github.com/M5Stack/M5Unified#develop
${lib_sdupdater.lib_deps}
Expand All @@ -29,3 +36,10 @@ lib_deps =
lib_deps =
M5StickC
${lib_sdupdater.lib_deps}


[lib_sdfatupdater]
lib_deps =
SdFat
M5Unified
${lib_sdupdater.lib_deps}
22 changes: 6 additions & 16 deletions examples/Test/build_test/main/main.cpp
Original file line number Diff line number Diff line change
@@ -1,32 +1,22 @@

#include <Arduino.h> // wtf platformio
#include <ESP32-targz.h>

#if defined TEST_LGFX

#include <SD.h> // WTF platformio lib_dep manager fails to resolve this ???
#include "../../../LGFX-SDLoader-Snippet/LGFX-SDLoader-Snippet.ino"
//#include <stddef.h>

#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 <SD.h> // WTF platformio lib_dep manager fails to resolve this ???
#include "../../../M5Unified/M5Unified.ino"

#elif defined TEST_SdFat
#include "../../../SdFatUpdater/SdFatUpdater.ino"
#else

#error "No device to test"

#endif


33 changes: 30 additions & 3 deletions examples/Test/build_test/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ platform_packages = framework-arduinoespressif32 @ https://github.com/espressif/
[lib_sdupdater]
lib_deps =
M5Stack-SD-Updater
tobozo/ESP32-targz
ESP32-targz

[lib_lgfx]
lib_deps =
SPI(esp32)
SD(esp32)
SPI
SD
${lib_sdupdater.lib_deps}
LovyanGFX
build_flags =
Expand All @@ -70,6 +70,7 @@ lib_deps =

[lib_m5unified]
lib_deps =
SD
${lib_sdupdater.lib_deps}
M5Unified

Expand All @@ -89,6 +90,12 @@ lib_deps =
M5GFX
Button2

[lib_sdfatupdater]
lib_deps =
SdFat
M5Unified
${lib_sdupdater.lib_deps}


[lgfx]
extends = lib_lgfx
Expand All @@ -113,6 +120,12 @@ build_flags = -DTEST_M5Core2
extends = lib_m5unified
build_flags = -DTEST_M5Unified

[M5Unifier-SdFat]
board = esp32dev
extends = lib_sdfatupdater
build_flags = -DTEST_SdFat


[S3Box]
extends = lib_chimeracore
board = esp32dev
Expand All @@ -139,6 +152,20 @@ build_flags =
[env:lgfx]
[env:s3box]
[env:m5stack-atom]
[env:sdfat-test]


[env:[email protected]]
board = esp32dev
lib_deps =
SdFat
M5Unified
M5Stack-SD-Updater
ESP32-targz@^1.1.8
build_flags = -DTEST_SdFat

extends = esp32_2_0_8, M5Unifier-SdFat


; [env:[email protected]]
; extends = esp32_2_0_5, M5Stack
Expand Down
8 changes: 7 additions & 1 deletion library.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@
"type": "git",
"url": "https://github.com/tobozo/M5Stack-SD-Updater.git"
},
"version": "1.2.4",
"dependencies": [
{
"name": "ESP32-targz",
"version": ">=1.1.7"
}
],
"version": "1.2.5",
"framework": "arduino",
"headers": "M5StackUpdater.h",
"platforms": "espressif32"
Expand Down
4 changes: 2 additions & 2 deletions library.properties
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name=M5Stack-SD-Updater
version=1.2.4
version=1.2.5
author=tobozo <[email protected]>
maintainer=tobozo <[email protected]>
sentence=SD Card Loader for M5 Stack
paragraph=Package your apps on an SD card and load them from a menu app, button or MQTT message.
category=Uncategorized
url=https://github.com/tobozo/M5Stack-SD-Updater/
architectures=esp32
depends=ArduinoJson
depends=ESP32-targz,ArduinoJson
Loading

0 comments on commit 62170f8

Please sign in to comment.