EEPROM reset-Function added to WebUI

This commit is contained in:
2022-08-22 14:28:32 +02:00
parent 6ffe239cae
commit 2ada3d9a61
3 changed files with 58 additions and 27 deletions

View File

@@ -19,15 +19,6 @@ void InitEEPROM()
{
return;
}
GetConfig_EEPROM();
if (LubeConfig.EEPROM_Version != eeVersion)
{
FormatConfig_EEPROM();
globals.systemStatus = sysStat_Error;
MaintainDTC(DTC_EEPROM_VERSION_BAD, true);
return;
}
}
void EEPROM_Process()
@@ -85,6 +76,7 @@ void GetConfig_EEPROM()
if (Checksum_EEPROM((uint8_t *)&LubeConfig, sizeof(LubeConfig)) != checksum)
{
MaintainDTC(DTC_EEPROM_CFG_BAD, DTC_CRITICAL, true);
FormatConfig_EEPROM();
}
LubeConfig.checksum = checksum;
}

View File

@@ -308,6 +308,15 @@ void WebserverPOST_Callback(AsyncWebServerRequest *request)
PersistenceData.tankRemain_µl = LubeConfig.tankCapacity_ml * 1000;
globals.requestEEAction = EE_PDS_SAVE;
}
if (p->name() == "reset_ee_cfg")
{
globals.requestEEAction = EE_CFG_FORMAT;
}
if (p->name() == "reset_ee_pds")
{
globals.requestEEAction = EE_PDS_FORMAT;
}
// end: POST Form Maintenance
}
}