diff --git a/Software/data_src/index.htm b/Software/data_src/index.htm index 2e0a5cc..a9bd44c 100644 --- a/Software/data_src/index.htm +++ b/Software/data_src/index.htm @@ -375,7 +375,7 @@
- + diff --git a/Software/src/config.cpp b/Software/src/config.cpp index c3af149..2c173ef 100644 --- a/Software/src/config.cpp +++ b/Software/src/config.cpp @@ -137,16 +137,16 @@ void GetPersistence_EEPROM() void FormatConfig_EEPROM() { - LubeConfig_t defaults; - LubeConfig = defaults; + Serial.println("Formatting Config-Partition"); + LubeConfig = LubeConfig_defaults; LubeConfig.EEPROM_Version = eeVersion; StoreConfig_EEPROM(); } void FormatPersistence_EEPROM() { - persistenceData_t defaults; - PersistenceData = defaults; + Serial.println("Formatting Persistance-Partition"); + memset(&PersistenceData, 0, sizeof(PersistenceData)); StorePersistence_EEPROM(); } diff --git a/Software/src/config.h b/Software/src/config.h index 555cc5d..21ab690 100644 --- a/Software/src/config.h +++ b/Software/src/config.h @@ -94,6 +94,16 @@ typedef struct uint32_t checksum = 0; } LubeConfig_t; +const LubeConfig_t LubeConfig_defaults{ + 0, 8000, 4000, 320, 72, 30, 1, 150, 70, 18, 2000, 25, SOURCE_IMPULSE, +#ifdef FEATURE_ENABLE_GPS + BAUD_115200, +#endif +#ifdef FEATURE_ENABLE_CAN + KTM_890_ADV_R_2021, +#endif + 0}; + void InitEEPROM(); void EEPROM_Process(); void StoreConfig_EEPROM(); diff --git a/Software/src/webui.cpp b/Software/src/webui.cpp index 92154f6..bbd1099 100644 --- a/Software/src/webui.cpp +++ b/Software/src/webui.cpp @@ -310,15 +310,15 @@ void WebserverPOST_Callback(AsyncWebServerRequest *request) } if (p->name() == "reset_ee_btn") { - if (request->hasParam("reset_ee_pds")) + if (request->hasParam("reset_ee_pds", true)) { - AsyncWebParameter *param = request->getParam("reset_ee_pds"); + AsyncWebParameter *param = request->getParam("reset_ee_pds", true); if (param->value() == "on") globals.requestEEAction = globals.requestEEAction == EE_CFG_FORMAT ? EE_FORMAT_ALL : EE_PDS_FORMAT; } - if (request->hasParam("reset_ee_cfg")) + if (request->hasParam("reset_ee_cfg", true)) { - AsyncWebParameter *param = request->getParam("reset_ee_cfg"); + AsyncWebParameter *param = request->getParam("reset_ee_cfg", true); if (param->value() == "on") globals.requestEEAction = globals.requestEEAction == EE_PDS_FORMAT ? EE_FORMAT_ALL : EE_CFG_FORMAT; }