better error handling
This commit is contained in:
parent
8c6253f198
commit
329981f5e6
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue