From 4473b5c7bdc62835861429edb08362881b3fd292 Mon Sep 17 00:00:00 2001 From: Daniel Eichhorn Date: Wed, 26 Jul 2017 21:28:35 +0200 Subject: [PATCH] Add formatting of the SPIFFS in case the file system could not be mounted --- esp8266-weather-station-color.ino | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/esp8266-weather-station-color.ino b/esp8266-weather-station-color.ino index 5a5ce80..eada7ea 100644 --- a/esp8266-weather-station-color.ino +++ b/esp8266-weather-station-color.ino @@ -158,7 +158,11 @@ void setup() { ts.begin(); - SPIFFS.begin(); + + bool isFSMounted = SPIFFS.begin(); + if (!isFSMounted) { + SPIFFS.format(); + } //SPIFFS.remove("/calibration.txt"); boolean isCalibrationAvailable = touchController.loadCalibration(); if (!isCalibrationAvailable) {