From ec429820b421b64d25de10229e4c46e59b210485 Mon Sep 17 00:00:00 2001 From: fvanroie Date: Sat, 1 Feb 2020 19:01:58 +0100 Subject: [PATCH] Move spiffsList function to spiffs --- src/hasp_config.cpp | 25 +------------------------ src/hasp_config.h | 2 -- src/hasp_spiffs.cpp | 4 ++-- src/hasp_spiffs.h | 1 + 4 files changed, 4 insertions(+), 28 deletions(-) diff --git a/src/hasp_config.cpp b/src/hasp_config.cpp index c9b38679..8dd2a0bd 100644 --- a/src/hasp_config.cpp +++ b/src/hasp_config.cpp @@ -16,35 +16,12 @@ #include "hasp_gui.h" #include "hasp_tft.h" #include "hasp_ota.h" +#include "hasp_spiffs.h" #include "hasp.h" //#define HASP_CONFIG_FILE F("/config.json") static const char HASP_CONFIG_FILE[] PROGMEM = "/config.json"; -void spiffsList() -{ -#if defined(ARDUINO_ARCH_ESP32) - debugPrintln(F("FILE: Listing files on the internal flash:")); - File root = SPIFFS.open("/"); - File file = root.openNextFile(); - while(file) { - char msg[64]; - sprintf_P(msg, PSTR("FILE: * %s (%u bytes)"), file.name(), (uint32_t)file.size()); - debugPrintln(msg); - file = root.openNextFile(); - } -#endif -#if defined(ARDUINO_ARCH_ESP8266) - debugPrintln(F("FILE: Listing files on the internal flash:")); - Dir dir = SPIFFS.openDir("/"); - while(dir.next()) { - char msg[64]; - sprintf_P(msg, PSTR("FILE: * %s (%u bytes)"), dir.fileName().c_str(), (uint32_t)dir.fileSize()); - debugPrintln(msg); - } -#endif -} - bool configChanged() { return false; diff --git a/src/hasp_config.h b/src/hasp_config.h index d1343ba2..f957645d 100644 --- a/src/hasp_config.h +++ b/src/hasp_config.h @@ -18,8 +18,6 @@ const char F_CONFIG_SSID[] PROGMEM = "ssid"; const char F_CONFIG_GROUP[] PROGMEM = "group"; const char F_GUI_TICKPERIOD[] PROGMEM = "tickperiod"; -void spiffsList(); - void configSetup(JsonDocument & settings); void configLoop(void); void configStop(void); diff --git a/src/hasp_spiffs.cpp b/src/hasp_spiffs.cpp index 3aeac636..56b5bb1c 100644 --- a/src/hasp_spiffs.cpp +++ b/src/hasp_spiffs.cpp @@ -11,7 +11,7 @@ #endif #include // Include the SPIFFS library #endif -/* + void spiffsList() { #if defined(ARDUINO_ARCH_ESP32) @@ -35,7 +35,7 @@ void spiffsList() } #endif } -*/ + void spiffsSetup() { // no SPIFFS settings, as settings depend on SPIFFS diff --git a/src/hasp_spiffs.h b/src/hasp_spiffs.h index ae43b23e..f82150a2 100644 --- a/src/hasp_spiffs.h +++ b/src/hasp_spiffs.h @@ -3,5 +3,6 @@ void spiffsSetup(void); void spiffsLoop(void); +void spiffsList(); #endif \ No newline at end of file