Fixed remaining SPIFFS code

This commit is contained in:
Spacehuhn 2020-07-05 16:34:27 +02:00
parent 3affb69cb5
commit 83cd397494
2 changed files with 5 additions and 4 deletions

View File

@ -65,8 +65,9 @@ void setup() {
// start SPIFFS
prnt(SETUP_MOUNT_SPIFFS);
bool spiffsError = !LittleFS.begin();
prntln(spiffsError ? SETUP_ERROR : SETUP_OK);
//bool spiffsError = !LittleFS.begin();
LittleFS.begin();
prntln(/*spiffsError ? SETUP_ERROR : */SETUP_OK);
// Start EEPROM
EEPROMHelper::begin(EEPROM_SIZE);
@ -84,7 +85,7 @@ void setup() {
#endif // ifdef FORMAT_EEPROM
// Format SPIFFS when in boot-loop
if (spiffsError || !EEPROMHelper::checkBootNum(BOOT_COUNTER_ADDR)) {
if (/*spiffsError || */!EEPROMHelper::checkBootNum(BOOT_COUNTER_ADDR)) {
prnt(SETUP_FORMAT_SPIFFS);
LittleFS.format();
prntln(SETUP_OK);

View File

@ -332,7 +332,7 @@ void startAP(String path, String ssid, String password, uint8_t ch, bool hidden,
});
// aggressively caching static assets
server.serveStatic("/js", SPIFFS, String(wifi_config_path + "/js").c_str(), "max-age=86400");
server.serveStatic("/js", LittleFS, String(wifi_config_path + "/js").c_str(), "max-age=86400");
// called when the url is not defined here
// use it to load content from SPIFFS