Fix lastChargingOnTime

Signed-off-by: Martin Kolací <martin.kolaci@lmc.eu>
This commit is contained in:
Martin Kolací
2020-12-28 20:46:43 +01:00
parent 1fd2bb0089
commit 612bc034b1
3 changed files with 8 additions and 2 deletions

View File

@@ -1499,8 +1499,8 @@ void Board320_240::mainLoop() {
setBrightness((liveData->settings.lcdBrightness == 0) ? 100 : liveData->settings.lcdBrightness);
}
// Go to sleep when car is off for more than 10s and not charging
if (liveData->params.currentTime - liveData->params.lastIgnitionOnTime > 10 && liveData->params.currentTime - liveData->params.lastIgnitionOnTime < MONTH_SEC
// Go to sleep when car is off for more than 30s and not charging (AC charger is disabled for few seconds when ignition is turned off)
if (liveData->params.currentTime - liveData->params.lastIgnitionOnTime > 30 && liveData->params.currentTime - liveData->params.lastIgnitionOnTime < MONTH_SEC
&& !liveData->params.chargingOn
&& liveData->params.lastIgnitionOnTime != 0
&& liveData->settings.sleepModeEnabled)

View File

@@ -185,6 +185,9 @@ void CarHyundaiIoniq::parseRowMerged() {
tempByte = liveData->hexToDecFromResponse(22, 24, 1, false);
liveData->params.chargingOn = (bitRead(tempByte, 5) == 1 || bitRead(tempByte, 6) == 1); // bit 5 = AC; bit 6 = DC
if(liveData->params.chargingOn) {
liveData->params.lastChargingOnTime = liveData->params.currentTime;
}
// This is more accurate than min/max from BMS. It's required to detect kona/eniro cold gates (min 15C is needed > 43kW charging, min 25C is needed > 58kW charging)
liveData->params.batInletC = liveData->hexToDecFromResponse(48, 50, 1, true);

View File

@@ -237,6 +237,9 @@ void CarKiaEniro::parseRowMerged() {
// liveData->params.chargingOn = (bitRead(tempByte, 2) == 1);
tempByte = liveData->hexToDecFromResponse(24, 26, 1, false);
liveData->params.chargingOn = (bitRead(tempByte, 5) == 1 || bitRead(tempByte, 6) == 1); // bit 5 = AC; bit 6 = DC
if(liveData->params.chargingOn) {
liveData->params.lastChargingOnTime = liveData->params.currentTime;
}
// This is more accurate than min/max from BMS. It's required to detect kona/eniro cold gates (min 15C is needed > 43kW charging, min 25C is needed > 58kW charging)
liveData->params.batMinC = liveData->params.batMaxC = liveData->params.batModuleTempC[0];