Whoops, that was a brain eraser
This commit is contained in:
parent
87c98e12ab
commit
9f1ee25a7b
|
@ -29,13 +29,13 @@ jobs:
|
|||
run: echo "PLATFORMIO_BUILD_FLAGS=-DVERSION='\"${GITHUB_REF#refs/*/}\"'" >> $GITHUB_ENV
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
- name: Run PlatformIO
|
||||
run: pio run -e esp32 -e m5stickc -e m5stickc-plus -e m5stack-atom
|
||||
run: pio run -e esp32 -e m5stickc -e m5stickc-plus -e m5atom-matrix
|
||||
- name: Rename firmware
|
||||
run: |
|
||||
cp .pio/build/esp32/firmware.bin esp32.bin
|
||||
cp .pio/build/m5stickc/firmware.bin m5stickc.bin
|
||||
cp .pio/build/m5stickc-plus/firmware.bin m5stickc-plus.bin
|
||||
cp .pio/build/m5stack-atom/firmware.bin m5stack-atom.bin
|
||||
cp .pio/build/m5atom-matrix/firmware.bin m5atom-matrix.bin
|
||||
- name: Release
|
||||
uses: softprops/action-gh-release@v1
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
|
|
|
@ -69,7 +69,7 @@ build_flags =
|
|||
-D PLUS
|
||||
-D FIRMWARE='"m5stickc-plus"'
|
||||
|
||||
[env:m5stack-atom]
|
||||
[env:m5atom-matrix]
|
||||
platform = espressif32
|
||||
platform_packages = framework-arduinoespressif32 @ https://github.com/DTTerastar/arduino-esp32.git#follow-redirects-http-update
|
||||
framework = arduino
|
||||
|
@ -87,7 +87,7 @@ monitor_speed = 115200
|
|||
build_flags =
|
||||
-D M5ATOM
|
||||
-D MATRIX
|
||||
-D FIRMWARE='"m5stack-atom"'
|
||||
-D FIRMWARE='"m5atom-matrix"'
|
||||
|
||||
[env:verbose]
|
||||
platform = espressif32
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
//Replace with the room name where the node will be placed
|
||||
#define DEFAULT_ROOM "living-room"
|
||||
|
||||
//Specify the LED pin. For most dev boards, this is GPIO2
|
||||
#ifdef M5STICK
|
||||
|
||||
#define LED_BUILTIN 10
|
||||
|
@ -38,14 +37,21 @@
|
|||
#define BUTTON 39
|
||||
#define BUTTON_PRESSED 0
|
||||
|
||||
#else
|
||||
#if M5ATOM
|
||||
|
||||
#define LED_BUILTIN 10
|
||||
#define LED_BUILTIN_ON 0
|
||||
|
||||
#define BUTTON 39
|
||||
#define BUTTON_PRESSED 0
|
||||
|
||||
#else // Huzzah32
|
||||
|
||||
#define LED_BUILTIN 13
|
||||
#define LED_BUILTIN_ON 1
|
||||
|
||||
#define BUTTON 39
|
||||
#define BUTTON_PRESSED 1
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef M5STICK
|
||||
|
|
29
src/main.cpp
29
src/main.cpp
|
@ -475,21 +475,9 @@ void firmwareUpdate(void)
|
|||
WiFiClientSecure client;
|
||||
client.setInsecure();
|
||||
|
||||
httpUpdate.setLedPin(LED_BUILTIN, LOW);
|
||||
httpUpdate.setLedPin(LED_BUILTIN, LED_BUILTIN_ON);
|
||||
httpUpdate.setFollowRedirects(HTTPC_FORCE_FOLLOW_REDIRECTS);
|
||||
#ifdef M5STICK
|
||||
#ifdef PLUS
|
||||
String firmwareUrl = String("https://github.com/DTTerastar/ESP32-mqtt-room/releases/latest/download/m5stickc-plus.bin");
|
||||
#else
|
||||
String firmwareUrl = String("https://github.com/DTTerastar/ESP32-mqtt-room/releases/latest/download/m5stickc.bin");
|
||||
#endif
|
||||
#else
|
||||
#ifdef M5ATOM
|
||||
String firmwareUrl = String("https://github.com/DTTerastar/ESP32-mqtt-room/releases/latest/download/m5stack-atom.bin");
|
||||
#else
|
||||
String firmwareUrl = String("https://github.com/DTTerastar/ESP32-mqtt-room/releases/latest/download/esp32.bin");
|
||||
#endif
|
||||
#endif
|
||||
String firmwareUrl = Sprintf("https://github.com/DTTerastar/ESP32-mqtt-room/releases/latest/download/%s.bin", FIRMWARE);
|
||||
|
||||
HTTPClient http;
|
||||
if (!http.begin(client, firmwareUrl))
|
||||
|
@ -530,12 +518,14 @@ void firmwareUpdate(void)
|
|||
void spiffsInit()
|
||||
{
|
||||
int ledState = HIGH;
|
||||
int flashes = 0;
|
||||
|
||||
unsigned long debounceDelay = 250;
|
||||
|
||||
digitalWrite(LED_BUILTIN, ledState);
|
||||
|
||||
#ifdef BUTTON
|
||||
|
||||
pinMode(BUTTON, INPUT);
|
||||
int flashes = 0;
|
||||
unsigned long debounceDelay = 250;
|
||||
|
||||
long lastDebounceTime = millis();
|
||||
while (digitalRead(BUTTON) == BUTTON_PRESSED)
|
||||
{
|
||||
|
@ -559,12 +549,13 @@ void spiffsInit()
|
|||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
SPIFFS.begin(true);
|
||||
}
|
||||
|
||||
void setup()
|
||||
{
|
||||
pinMode(BUTTON, INPUT);
|
||||
pinMode(LED_BUILTIN, OUTPUT);
|
||||
|
||||
Serial.begin(115200);
|
||||
|
|
Loading…
Reference in New Issue