mirror of
https://github.com/HASwitchPlate/HASPone.git
synced 2025-07-24 11:46:33 +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"))
|
||||
{ // File exists, reading and loading
|
||||
debugPrintln(F("SPIFFS: reading /config.json"));
|
||||
debugPrintFile("/config.json");
|
||||
File configFile = SPIFFS.open("/config.json", "r");
|
||||
if (configFile)
|
||||
{
|
||||
@ -2376,9 +2377,11 @@ void configSave()
|
||||
else
|
||||
{
|
||||
serializeJson(jsonConfigValues, configFile);
|
||||
configFile.println("");
|
||||
yield();
|
||||
configFile.close();
|
||||
}
|
||||
debugPrintFile("/config.json");
|
||||
shouldSaveConfig = false;
|
||||
}
|
||||
|
||||
@ -3681,6 +3684,25 @@ void debugPrintCrash()
|
||||
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
|
||||
// incoming String by separator, return selected field as String
|
||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user