Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions JeeUI2.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <FS.h>
#else
#include <AsyncTCP.h>
#include "SPIFFS.h"
#include "LittleFS.h"
#endif

#include <ESPAsyncWebServer.h>
Expand Down Expand Up @@ -195,4 +195,4 @@ class jeeui2

};

#endif
#endif
10 changes: 5 additions & 5 deletions config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

void jeeui2::save()
{
if(SPIFFS.begin()){
if(LittleFS.begin()){
}
File configFile = SPIFFS.open(F("/config.json"), "w");
File configFile = LittleFS.open(F("/config.json"), "w");

String cfg_str;
serializeJson(cfg, cfg_str);
Expand Down Expand Up @@ -39,9 +39,9 @@ void jeeui2::as(){

void jeeui2::load()
{
if(SPIFFS.begin()){
if(LittleFS.begin()){
}
File pre_configFile = SPIFFS.open(F("/config.json"), "r");
File pre_configFile = LittleFS.open(F("/config.json"), "r");
if (pre_configFile.readString() == "")
{
if(dbg)Serial.println(F("Failed to open config file"));
Expand All @@ -52,4 +52,4 @@ void jeeui2::load()
String cfg_str = configFile.readString();
deserializeJson(cfg, cfg_str);
if(dbg)Serial.println(F("JSON config loaded"));
}
}
4 changes: 2 additions & 2 deletions config.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#ifdef ESP8266
#include <FS.h>
#else
#include "SPIFFS.h"
#include "LittleFS.h"
#endif

#endif
#endif
4 changes: 2 additions & 2 deletions gpio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ void jeeui2::btn()
if (t + 15000 < millis()) // Нажатие 10 секунд
{
led_inv();
SPIFFS.remove("/config.json");
LittleFS.remove("/config.json");
ESP.restart();
}
}
Expand Down Expand Up @@ -91,4 +91,4 @@ void jeeui2::ui(void (*uiFunction) ())

void testFunction(){

}
}