better initialization handling

This commit is contained in:
rusefi 2017-04-13 08:28:41 -04:00
parent ea8395550e
commit 060f07f388
1 changed files with 7 additions and 1 deletions

View File

@ -222,7 +222,13 @@ floatms_t getBaseTableFuel(int rpm, float engineLoad) {
warning(CUSTOM_NAN_ENGINE_LOAD_2, "NaN engine load");
return NAN;
}
return fuelMap.getValue(rpm, engineLoad);
floatms_t result = fuelMap.getValue(rpm, engineLoad);
if (cisnan(result)) {
// result could be NaN in case of invalid table, like during initialization
result = 0;
warning(CUSTOM_ERR_6138, "baseFuel table not ready");
}
return result;
}
float getBaroCorrection(DECLARE_ENGINE_PARAMETER_F) {