serial is off for upgrades, on for new installs

This commit is contained in:
proddy
2019-02-03 21:23:42 +01:00
parent f730287ec6
commit 89a6b838c5

View File

@@ -831,6 +831,8 @@ bool MyESP::_fs_loadConfig() {
File configFile = SPIFFS.open("/config.json", "r");
if (!configFile) {
myDebug_P(PSTR("[FS] Failed to open config file"));
// file does not exist, so assume its the first install. Set serial to on
_use_serial = true;
return false;
}
@@ -874,7 +876,7 @@ bool MyESP::_fs_loadConfig() {
if (json.containsKey("use_serial")) {
_use_serial = (bool)json["use_serial"];
} else {
_use_serial = true; // if first time, set serial
_use_serial = false; // if first time, set serial to off
ok = false;
}