reworked DTC-Data handling
This commit is contained in:
@@ -83,6 +83,12 @@ void StoreConfig_EEPROM()
|
||||
return;
|
||||
|
||||
ee.updateBlock(startofLubeConfig, (uint8_t *)&LubeConfig, sizeof(LubeConfig));
|
||||
|
||||
uint32_t ConfigSanityCheckResult = ConfigSanityCheck(false);
|
||||
if (ConfigSanityCheckResult > 0)
|
||||
{
|
||||
MaintainDTC(DTC_EEPROM_CFG_SANITY, true, ConfigSanityCheckResult);
|
||||
}
|
||||
}
|
||||
|
||||
void GetConfig_EEPROM()
|
||||
@@ -97,16 +103,14 @@ void GetConfig_EEPROM()
|
||||
|
||||
if (Checksum_EEPROM((uint8_t *)&LubeConfig, sizeof(LubeConfig)) != checksum)
|
||||
{
|
||||
MaintainDTC(DTC_EEPROM_CFG_BAD, DTC_CRITICAL, true);
|
||||
MaintainDTC(DTC_EEPROM_CFG_BAD, true);
|
||||
}
|
||||
LubeConfig.checksum = checksum;
|
||||
|
||||
uint32_t ConfigSanityCheckResult = ConfigSanityCheck(false);
|
||||
|
||||
if (ConfigSanityCheckResult > 0)
|
||||
{
|
||||
MaintainDTC(DTC_EEPROM_CFG_SANITY, DTC_WARN, true, ConfigSanityCheckResult);
|
||||
globals.requestEEAction = EE_CFG_SAVE;
|
||||
MaintainDTC(DTC_EEPROM_CFG_SANITY, true, ConfigSanityCheckResult);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -138,7 +142,7 @@ void GetPersistence_EEPROM()
|
||||
{
|
||||
MovePersistencePage_EEPROM(true);
|
||||
FormatPersistence_EEPROM();
|
||||
MaintainDTC(DTC_EEPROM_PDSADRESS_BAD, DTC_CRITICAL, true);
|
||||
MaintainDTC(DTC_EEPROM_PDSADRESS_BAD, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -149,7 +153,7 @@ void GetPersistence_EEPROM()
|
||||
|
||||
if (Checksum_EEPROM((uint8_t *)&PersistenceData, sizeof(PersistenceData)) != checksum)
|
||||
{
|
||||
MaintainDTC(DTC_EEPROM_PDS_BAD, DTC_CRITICAL, true);
|
||||
MaintainDTC(DTC_EEPROM_PDS_BAD, true);
|
||||
}
|
||||
PersistenceData.checksum = checksum;
|
||||
}
|
||||
@@ -245,10 +249,10 @@ boolean checkEEPROMavailable()
|
||||
{
|
||||
if (!ee.isConnected())
|
||||
{
|
||||
MaintainDTC(DTC_NO_EEPROM_FOUND, DTC_CRITICAL, true);
|
||||
MaintainDTC(DTC_NO_EEPROM_FOUND, true);
|
||||
return false;
|
||||
}
|
||||
MaintainDTC(DTC_NO_EEPROM_FOUND, DTC_CRITICAL, false);
|
||||
MaintainDTC(DTC_NO_EEPROM_FOUND, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user