Compare commits

..

No commits in common. "80c4c434c566691f70dbb32cde13ad8a261bcf0e" and "d78c73d61f09accbe3ca2efe7059bad6b06e78cc" have entirely different histories.

4 changed files with 18 additions and 34 deletions

View File

@ -312,14 +312,14 @@
<div class="form-group">
<div class="col-xs-offset-5 col-xs-7">
<div class="form-check">
<input class="form-check-input" type="checkbox" value="" id="reset_ee_cfg">
<label class="form-check-label" for="reset_ee_cfg">
<input class="form-check-input" type="checkbox" value="" id="reset_ee_cfg_check">
<label class="form-check-label" for="reset_ee_cfg_check">
JA, EEPROM-Bereich "CFG" formatieren und Konfiguration zurück setzen
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" value="" id="reset_ee_pds">
<label class="form-check-label" for="reset_ee_pds">
<input class="form-check-input" type="checkbox" value="" id="reset_ee_pds_check">
<label class="form-check-label" for="reset_ee_pds_check">
JA, EEPROM-Bereich "PDS" formatieren und Betriebsdaten zurück setzen
</label>
</div>

View File

@ -15,11 +15,15 @@ boolean checkEEPROMavailable();
void InitEEPROM()
{
ee.begin();
checkEEPROMavailable();
if (!checkEEPROMavailable())
{
return;
}
}
void EEPROM_Process()
{
switch (globals.requestEEAction)
{
case EE_CFG_SAVE:
@ -30,11 +34,6 @@ void EEPROM_Process()
GetConfig_EEPROM();
globals.requestEEAction = EE_IDLE;
break;
case EE_CFG_FORMAT:
FormatConfig_EEPROM();
globals.requestEEAction = EE_IDLE;
globals.systemStatus = sysStat_Shutdown;
break;
case EE_PDS_SAVE:
StorePersistence_EEPROM();
globals.requestEEAction = EE_IDLE;
@ -43,15 +42,6 @@ void EEPROM_Process()
GetPersistence_EEPROM();
globals.requestEEAction = EE_IDLE;
break;
case EE_PDS_FORMAT:
FormatPersistence_EEPROM();
globals.requestEEAction = EE_IDLE;
break;
case EE_FORMAT_ALL:
FormatConfig_EEPROM();
FormatPersistence_EEPROM();
globals.requestEEAction = EE_IDLE;
break;
case EE_ALL_SAVE:
StorePersistence_EEPROM();
StoreConfig_EEPROM();
@ -86,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

@ -22,7 +22,6 @@ typedef enum eEERequest
EE_PDS_SAVE,
EE_PDS_LOAD,
EE_PDS_FORMAT,
EE_FORMAT_ALL,
EE_ALL_SAVE
} tEERequest;

View File

@ -9,7 +9,7 @@ void WebserverPOST_Callback(AsyncWebServerRequest *request);
void WebserverNotFound_Callback(AsyncWebServerRequest *request);
void Webserver_Callback(AsyncWebServerRequest *request);
void WebserverFirmwareUpdate_Callback(AsyncWebServerRequest *request, const String &filename, size_t index, uint8_t *data, size_t len, bool final);
void GetFlashVersion(char *buff, size_t buff_size);
uint32_t GetFlashVersion();
void initWebUI()
{
@ -308,21 +308,15 @@ void WebserverPOST_Callback(AsyncWebServerRequest *request)
PersistenceData.tankRemain_µl = LubeConfig.tankCapacity_ml * 1000;
globals.requestEEAction = EE_PDS_SAVE;
}
if (p->name() == "reset_ee_btn")
if (p->name() == "reset_ee_cfg")
{
if (request->hasParam("reset_ee_pds"))
{
AsyncWebParameter *param = request->getParam("reset_ee_pds");
if (param->value() == "checked")
globals.requestEEAction = globals.requestEEAction == EE_CFG_FORMAT ? EE_FORMAT_ALL : EE_PDS_FORMAT;
}
if (request->hasParam("reset_ee_cfg"))
{
AsyncWebParameter *param = request->getParam("reset_ee_cfg");
if (param->value() == "checked")
globals.requestEEAction = globals.requestEEAction == EE_PDS_FORMAT ? EE_FORMAT_ALL : EE_CFG_FORMAT;
}
globals.requestEEAction = EE_CFG_FORMAT;
}
if (p->name() == "reset_ee_pds")
{
globals.requestEEAction = EE_PDS_FORMAT;
}
// end: POST Form Maintenance
}
}