Move spiffsList function to spiffs

This commit is contained in:
fvanroie 2020-02-01 19:01:58 +01:00
parent 2aa5e59fea
commit ec429820b4
4 changed files with 4 additions and 28 deletions

View File

@ -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;

View File

@ -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);

View File

@ -11,7 +11,7 @@
#endif
#include <FS.h> // 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

View File

@ -3,5 +3,6 @@
void spiffsSetup(void);
void spiffsLoop(void);
void spiffsList();
#endif