Fixed one bug
This commit is contained in:
parent
17db726612
commit
00576355ff
@ -214,6 +214,7 @@ void onConfirmReceiving(const uint8_t *target, const uint16_t id, const bool sta
|
|||||||
|
|
||||||
void loadConfig()
|
void loadConfig()
|
||||||
{
|
{
|
||||||
|
ETS_GPIO_INTR_DISABLE();
|
||||||
if (!LittleFS.exists("/config.json"))
|
if (!LittleFS.exists("/config.json"))
|
||||||
saveConfig();
|
saveConfig();
|
||||||
File file = LittleFS.open("/config.json", "r");
|
File file = LittleFS.open("/config.json", "r");
|
||||||
@ -235,10 +236,13 @@ void loadConfig()
|
|||||||
green = json["green"];
|
green = json["green"];
|
||||||
blue = json["blue"];
|
blue = json["blue"];
|
||||||
file.close();
|
file.close();
|
||||||
|
delay(50);
|
||||||
|
ETS_GPIO_INTR_ENABLE();
|
||||||
}
|
}
|
||||||
|
|
||||||
void saveConfig()
|
void saveConfig()
|
||||||
{
|
{
|
||||||
|
ETS_GPIO_INTR_DISABLE();
|
||||||
StaticJsonDocument<512> json;
|
StaticJsonDocument<512> json;
|
||||||
json["firmware"] = firmware;
|
json["firmware"] = firmware;
|
||||||
json["espnowNetName"] = espnowNetName;
|
json["espnowNetName"] = espnowNetName;
|
||||||
@ -259,6 +263,8 @@ void saveConfig()
|
|||||||
File file = LittleFS.open("/config.json", "w");
|
File file = LittleFS.open("/config.json", "w");
|
||||||
serializeJsonPretty(json, file);
|
serializeJsonPretty(json, file);
|
||||||
file.close();
|
file.close();
|
||||||
|
delay(50);
|
||||||
|
ETS_GPIO_INTR_ENABLE();
|
||||||
}
|
}
|
||||||
|
|
||||||
void setupWebServer()
|
void setupWebServer()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user