diff --git a/Arduino/CanGrow/CanGrow.ino b/Arduino/CanGrow/CanGrow.ino index d126f5b..0c3e3c5 100644 --- a/Arduino/CanGrow/CanGrow.ino +++ b/Arduino/CanGrow/CanGrow.ino @@ -59,10 +59,12 @@ #include // https://github.com/PaulStoffregen/Time #include +#include "FS.h" // arduino-core for esp8266 and esp32 #include "LittleFS.h" + void setup() { // define output for onboard LED/WIPE pin pinMode(PinWIPE, OUTPUT); @@ -93,13 +95,26 @@ void setup() { } delay(333); } - // set back to HIGH because thats the default + + #ifdef ESP8266 + // set back to HIGH because thats the default on esp8266 digitalWrite(PinWIPE, HIGH); - //delay(2000); + #endif + #ifdef ESP32 + // set back to HIGH because thats the default esp32 + digitalWrite(PinWIPE, LOW); + #endif + // read status from PinWIPE to WIPE // when PinWIPE is set to LOW, format LittleFS + + #ifdef ESP8266 if(digitalRead(PinWIPE) == LOW) { + #endif + #ifdef ESP32 + if(digitalRead(PinWIPE) == HIGH) { + #endif Serial.println("!! formatting LittleFS !!"); LittleFS.format(); Panic(); diff --git a/Arduino/CanGrow/include/CanGrow.h b/Arduino/CanGrow/include/CanGrow.h index e281ab0..a45efa3 100644 --- a/Arduino/CanGrow/include/CanGrow.h +++ b/Arduino/CanGrow/include/CanGrow.h @@ -30,6 +30,7 @@ #include "CanGrow_Version.h" +//#define FORMAT_LITTLEFS_IF_FAILED false const char* configfile = "config.json"; #ifdef ESP8266 diff --git a/Arduino/CanGrow/include/CanGrow_Version.h b/Arduino/CanGrow/include/CanGrow_Version.h deleted file mode 100644 index f5e5a73..0000000 --- a/Arduino/CanGrow/include/CanGrow_Version.h +++ /dev/null @@ -1,5 +0,0 @@ -/* CanGrow_Version.h gets generated from cangrow.sh */ - -const char* CanGrowVer = "0.2-dev"; -const char* CanGrowBuild = "529bd7e-20241017010523"; -