mirror of
https://github.com/HASwitchPlate/HASPone.git
synced 2025-07-27 13:16:44 +00:00
Append newline to config.json and add file debug
This commit is contained in:
parent
16a5695621
commit
efd785a458
Binary file not shown.
@ -2158,6 +2158,7 @@ void configRead()
|
|||||||
if (SPIFFS.exists("/config.json"))
|
if (SPIFFS.exists("/config.json"))
|
||||||
{ // File exists, reading and loading
|
{ // File exists, reading and loading
|
||||||
debugPrintln(F("SPIFFS: reading /config.json"));
|
debugPrintln(F("SPIFFS: reading /config.json"));
|
||||||
|
debugPrintFile("/config.json");
|
||||||
File configFile = SPIFFS.open("/config.json", "r");
|
File configFile = SPIFFS.open("/config.json", "r");
|
||||||
if (configFile)
|
if (configFile)
|
||||||
{
|
{
|
||||||
@ -2376,9 +2377,11 @@ void configSave()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
serializeJson(jsonConfigValues, configFile);
|
serializeJson(jsonConfigValues, configFile);
|
||||||
|
configFile.println("");
|
||||||
yield();
|
yield();
|
||||||
configFile.close();
|
configFile.close();
|
||||||
}
|
}
|
||||||
|
debugPrintFile("/config.json");
|
||||||
shouldSaveConfig = false;
|
shouldSaveConfig = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3681,6 +3684,25 @@ void debugPrintCrash()
|
|||||||
SaveCrash.clear();
|
SaveCrash.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
void debugPrintFile(const String &fileName)
|
||||||
|
{ // Debug output line of text to our debug targets
|
||||||
|
File debugFile = SPIFFS.open(fileName, "r");
|
||||||
|
if (debugFile)
|
||||||
|
{
|
||||||
|
uint16_t lineCount = 1;
|
||||||
|
while (debugFile.available())
|
||||||
|
{
|
||||||
|
debugPrintln(F("SPIFFS: file:") + fileName + F(" line:") + String(lineCount) + F(" data:")+ debugFile.readStringUntil('\n'));
|
||||||
|
lineCount++;
|
||||||
|
}
|
||||||
|
debugFile.close();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
debugPrintln("SPIFFS: Error opening file for read: " + fileName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// Submitted by benmprojects to handle "beep" commands. Split
|
// Submitted by benmprojects to handle "beep" commands. Split
|
||||||
// incoming String by separator, return selected field as String
|
// incoming String by separator, return selected field as String
|
||||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user