From bf8c19c3fc59a9f3324cdcaea0c7aa9ce8c5771e Mon Sep 17 00:00:00 2001 From: Lukas Bachschwell Date: Mon, 25 Dec 2017 16:39:54 +0100 Subject: [PATCH] Fixing ESP8266 file format --- src/ESPUI.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/ESPUI.cpp b/src/ESPUI.cpp index 627cad0..4081480 100644 --- a/src/ESPUI.cpp +++ b/src/ESPUI.cpp @@ -50,10 +50,16 @@ void ESPUIClass::prepareFileSystem(){ // this function should only be used once Serial.println('About to prepare filesystem...'); -if(!SPIFFS.begin(true)) { - Serial.println("SPIFFS Mount Failed"); - return; -} + +#if defined(ESP32) + if(!SPIFFS.begin(true)) { + Serial.println("SPIFFS Mount Failed"); + return; + } +#else + SPIFFS.begin(); + SPIFFS.format(); +#endif deleteFile(SPIFFS, "/index.htm");