From e1475afa0043db49d516ca6cef5ee20730a48f21 Mon Sep 17 00:00:00 2001 From: Oliver Fassbender Date: Wed, 29 Jul 2020 10:14:12 +0200 Subject: [PATCH] Migration from deprecated SPIFFS to LittleFS Signed-off-by: Oliver Fassbender --- printermonitor/Settings.h | 1 + printermonitor/printermonitor.ino | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/printermonitor/Settings.h b/printermonitor/Settings.h index a149b82..29327a4 100644 --- a/printermonitor/Settings.h +++ b/printermonitor/Settings.h @@ -49,6 +49,7 @@ SOFTWARE. #include "OctoPrintClient.h" #include "OpenWeatherMapClient.h" #include "WeatherStationFonts.h" +#include "LittleFS.h" #include "FS.h" #include "SH1106Wire.h" #include "SSD1306Wire.h" diff --git a/printermonitor/printermonitor.ino b/printermonitor/printermonitor.ino index 8849850..0c89ec5 100644 --- a/printermonitor/printermonitor.ino +++ b/printermonitor/printermonitor.ino @@ -198,7 +198,7 @@ static const char COLOR_THEMES[] PROGMEM = "" void setup() { Serial.begin(115200); - SPIFFS.begin(); + LittleFS.begin(); delay(10); //New Line to clear from start garbage @@ -435,7 +435,7 @@ void handleSystemReset() { return server.requestAuthentication(); } Serial.println("Reset System Configuration"); - if (SPIFFS.remove(CONFIG)) { + if (LittleFS.remove(CONFIG)) { redirectHome(); ESP.restart(); } @@ -1114,8 +1114,8 @@ int8_t getWifiQuality() { void writeSettings() { - // Save decoded message to SPIFFS file for playback on power up. - File f = SPIFFS.open(CONFIG, "w"); + // Save decoded message to LittleFS file for playback on power up. + File f = LittleFS.open(CONFIG, "w"); if (!f) { Serial.println("File open failed!"); } else { @@ -1150,12 +1150,12 @@ void writeSettings() { } void readSettings() { - if (SPIFFS.exists(CONFIG) == false) { + if (LittleFS.exists(CONFIG) == false) { Serial.println("Settings File does not yet exists."); writeSettings(); return; } - File fr = SPIFFS.open(CONFIG, "r"); + File fr = LittleFS.open(CONFIG, "r"); String line; while(fr.available()) { line = fr.readStringUntil('\n');