Skip to content

Commit

Permalink
Merge pull request #163 from tobozo/1.1.6
Browse files Browse the repository at this point in the history
1.1.6
  • Loading branch information
tobozo authored Nov 9, 2021
2 parents f92197d + c891788 commit c984795
Show file tree
Hide file tree
Showing 23 changed files with 796 additions and 548 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/LibraryBuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
- name: ${{ matrix.matrix-context }}
uses: ArminJo/arduino-test-compile@v3
with:
platform-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
platform-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json
arduino-board-fqbn: ${{ matrix.arduino-boards-fqbn }}
required-libraries: ${{ matrix.required-libraries }}
extra-arduino-lib-install-args: --no-deps
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
build
.pio/
17 changes: 9 additions & 8 deletions examples/Headless/Headless.ino
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#define SDU_APP_NAME "Headless() Example"
#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 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 <M5StackUpdater.h>


static int myActionTrigger( char* labelLoad, char* labelSkip, unsigned long waitdelay )
static int myActionTrigger( char* labelLoad, char* labelSkip, char* labelSave, unsigned long waitdelay )
{
int64_t msec = millis();
do {
Expand All @@ -14,6 +15,7 @@ static int myActionTrigger( char* labelLoad, char* labelSkip, unsigned long wai
if( out == "update" ) return 1; // load "/menu.bin"
else if( out == "rollback") return 0; // rollback to other OTA partition
else if( out == "skip" ) return -1; // do nothing
else if( out == "save" ) return 2;
else Serial.printf("Ignored command: %s\n", out.c_str() );
}
} while( msec > int64_t( millis() ) - int64_t( waitdelay ) );
Expand All @@ -25,25 +27,24 @@ void setup()
{
Serial.begin( 115200 );
Serial.println("Welcome to the SD-Updater Headless example!");
Serial.println("Now checking if a button was pushed during boot ...");
Serial.println("Now waiting 30 seconds for user input in Serial console...");

SDUCfg.setWaitForActionCb( myActionTrigger );
checkSDUpdater( SD );
/*

checkSDUpdater(
SD, // filesystem (default=SD)
MENU_BIN, // path to binary (default=/menu.bin, empty string=rollback only)
30000, // wait delay in milliseconds (default=0, e,g, 30000 will be forced to 30 seconds upon ESP.restart() )
TFCARD_CS_PIN // (usually default=4 but your mileage may vary)
);
*/
Serial.println("Nope, will run the sketch normally");

Serial.println("Starting application");


}

void loop()
{



}
39 changes: 1 addition & 38 deletions examples/M5Stack-SD-Menu/M5Stack-SD-Menu.ino
Original file line number Diff line number Diff line change
Expand Up @@ -77,43 +77,6 @@
*
*/

#include "menu.h"
#include "main/main.cpp"



void setup() {
#if defined(_CHIMERA_CORE_)
M5.begin(true, false, true, false, false); // bool LCDEnable, bool SDEnable, bool SerialEnable, bool I2CEnable, bool ScreenShotEnable
#else
M5.begin(); // bool LCDEnable, bool SDEnable, bool SerialEnable, bool I2CEnable, bool ScreenShotEnable
#endif

sdUpdater = new SDUpdater();
// suggest rollback
sdUpdater->checkSDUpdaterUI(
SD, // filesystem (default=SD)
"", // path to binary (default = /menu.bin, empty = rollback only)
0 // wait delay, (default=0, will be forced to 2000 upon ESP.restart() )
);

#if defined(_CHIMERA_CORE_)
// debug I2C
//Wire.begin(SDA, SCL);
//M5.I2C.scan();
#endif

//WiFi.onEvent(WiFiEvent); // helps debugging WiFi problems with the Serial console
UISetup(); // UI init and check if a SD exists

doFSChecks(); // replicate on SD and app1 partition, scan data folder, load registry
doFSInventory(); // enumerate apps and render menu

}


void loop() {

HIDMenuObserve();
sleepTimer();

}
Loading

0 comments on commit c984795

Please sign in to comment.