better error handling

This commit is contained in:
rusEfi 2017-04-12 23:48:35 -04:00
parent 8c6253f198
commit 329981f5e6
1 changed files with 6 additions and 0 deletions

View File

@ -37,6 +37,12 @@ float getTCharge(int rpm, float tps, float coolantTemp, float airTemp DECLARE_EN
float Tcharge = coolantTemp * (1 - Tcharge_coff) + airTemp * Tcharge_coff;
if (cisnan(Tcharge)) {
// we can probably end up here while resetting engine state - interpolation would fail
warning(CUSTOM_ERR_6136, "getTCharge NaN");
return coolantTemp;
}
return Tcharge;
}