better constraint validation

This commit is contained in:
rusefi 2017-04-13 08:01:59 -04:00
parent 329981f5e6
commit ea8395550e
1 changed files with 4 additions and 1 deletions

View File

@ -86,7 +86,10 @@ floatms_t getSpeedDensityFuel(DECLARE_ENGINE_PARAMETER_F) {
* most of the values are pre-calculated for performance reasons
*/
float tChargeK = ENGINE(engineState.tChargeK);
efiAssert(!cisnan(tChargeK), "NaN tChargeK", 0);
if (cisnan(tChargeK)) {
warning(CUSTOM_ERR_6139, "tChargeK not ready"); // this would happen before we have CLT reading for example
return 0;
}
float map = getMap();
efiAssert(!cisnan(map), "NaN map", 0);