Clear debug config on setup if not already set

This commit is contained in:
Gunnar Skjold
2021-09-23 20:56:24 +02:00
parent 7412ba2697
commit 13bbc81b7f
3 changed files with 13 additions and 0 deletions

View File

@@ -741,6 +741,9 @@ void AmsWebServer::handleSetup() {
} else {
SystemConfig sys { server.arg("board").toInt() };
DebugConfig debugConfig;
config->getDebugConfig(debugConfig);
config->clear();
config->clearGpio(*gpioConfig);
@@ -882,6 +885,8 @@ void AmsWebServer::handleSetup() {
success = false;
}
config->setDebugConfig(debugConfig);
if(success && config->save()) {
performRestart = true;
server.sendHeader("Location","/restart-wait");