diff --git a/README.md b/README.md index 3c44e17..141f730 100644 --- a/README.md +++ b/README.md @@ -234,6 +234,9 @@ Work is in progress... --- ## Version history +### v0.9.373 +- fixed the issue with displaying the settings page on fresh ESP modules after saving the weather key + #### v0.9.370 - fixed the issue with saving settings on fresh ESP modules. diff --git a/yoRadio/src/core/config.cpp b/yoRadio/src/core/config.cpp index 5d13993..03040cb 100644 --- a/yoRadio/src/core/config.cpp +++ b/yoRadio/src/core/config.cpp @@ -286,7 +286,7 @@ template int Config::eepromRead(int ee, T& value) { void Config::reset(){ setDefaults(); eepromWrite(EEPROM_START, store); - delay(100); + delay(500); ESP.restart(); } diff --git a/yoRadio/src/core/config.h b/yoRadio/src/core/config.h index 77c5177..886e265 100644 --- a/yoRadio/src/core/config.h +++ b/yoRadio/src/core/config.h @@ -250,7 +250,7 @@ class Config { if (strcmp(field, value) == 0 && !force) return; strlcpy(field, value, N); size_t address = getAddr(field); - for (size_t i = 0; i < strlen(field); i++) EEPROM.write(address + i, field[i]); + for (size_t i = 0; i <= strlen(field); i++) EEPROM.write(address + i, field[i]); if(commit) EEPROM.commit(); } diff --git a/yoRadio/src/core/netserver.cpp b/yoRadio/src/core/netserver.cpp index 3a80bfd..a31866e 100644 --- a/yoRadio/src/core/netserver.cpp +++ b/yoRadio/src/core/netserver.cpp @@ -840,7 +840,7 @@ void handleHTTPArgs(AsyncWebServerRequest * request) { if (request->hasArg("next")) { player.next(); commandFound=true; } if (request->hasArg("volm")) { player.stepVol(false); commandFound=true; } if (request->hasArg("volp")) { player.stepVol(true); commandFound=true; } - if (request->hasArg("reset")) { config.reset(); commandFound=true; } + if (request->hasArg("reset")) { request->redirect("/"); request->send(200); config.reset(); return; } if (request->hasArg("trebble") && request->hasArg("middle") && request->hasArg("bass")) { AsyncWebParameter* pt = request->getParam("trebble", request->method() == HTTP_POST); AsyncWebParameter* pm = request->getParam("middle", request->method() == HTTP_POST); diff --git a/yoRadio/src/core/options.h b/yoRadio/src/core/options.h index a84d8e2..ab25389 100644 --- a/yoRadio/src/core/options.h +++ b/yoRadio/src/core/options.h @@ -1,7 +1,7 @@ #ifndef options_h #define options_h -#define YOVERSION "0.9.370" +#define YOVERSION "0.9.373" /******************************************************* DO NOT EDIT THIS FILE.