From e703486543e10051e5bf353c6a747039b0d36684 Mon Sep 17 00:00:00 2001 From: Stefan Kremser Date: Fri, 17 May 2019 11:38:48 +0200 Subject: [PATCH] Option for forced formatting of spiffs and eeprom --- esp8266_deauther/A_config.h | 10 ++++++++-- esp8266_deauther/EEPROMHelper.h | 5 +++++ esp8266_deauther/esp8266_deauther.ino | 17 +++++++++++++++++ esp8266_deauther/language.h | 1 + 4 files changed, 31 insertions(+), 2 deletions(-) diff --git a/esp8266_deauther/A_config.h b/esp8266_deauther/A_config.h index 9618a0b..5bcf00d 100644 --- a/esp8266_deauther/A_config.h +++ b/esp8266_deauther/A_config.h @@ -1,7 +1,11 @@ #ifndef config_h #define config_h -/* !!! Uncomment the board taht you're using !!! */ +#define DEFAULT_ESP8266 + +/* ---------------------------------------------------------- */ +/* ===>> !!! Uncomment the board taht you're using: !!! <<=== */ +/* ---------------------------------------------------------- */ // #define NODEMCU // #define WEMOS_D1_MINI @@ -34,7 +38,9 @@ // #define LYASI_7W_E27_LAMP // #define AVATAR_5W_E14_LAMP -#define DEFAULT_ESP8266 +// Forces formatting of SPIFFS and EEPROM ot startup +// #define FORMAT_SPIFFS +// #define FORMAT_EEPROM // Forces a reset of all settings at startup // #define RESET_SETTINGS diff --git a/esp8266_deauther/EEPROMHelper.h b/esp8266_deauther/EEPROMHelper.h index 0f3668b..fc73a85 100644 --- a/esp8266_deauther/EEPROMHelper.h +++ b/esp8266_deauther/EEPROMHelper.h @@ -53,6 +53,11 @@ class EEPROMHelper { static void resetBootNum(const int address) { saveObject(address, boot{ BOOT_MAGIC_NUM, 1 }); } + + static void format(unsigned long size) { + for (unsigned long i = 0; i