better state validation

This commit is contained in:
rusEfi 2017-12-03 15:30:42 -05:00
parent 97a310a502
commit c9b9d3ae9e
1 changed files with 3 additions and 0 deletions

View File

@ -98,6 +98,9 @@ floatms_t getBaseFuel(int rpm DECLARE_ENGINE_PARAMETER_SUFFIX) {
angle_t getinjectionOffset(float rpm DECLARE_ENGINE_PARAMETER_SUFFIX) {
float engineLoad = getEngineLoadT(PASS_ENGINE_PARAMETER_SIGNATURE);
if (isnan(engineLoad)) {
return 0; // error already reported
}
angle_t result = fuelPhaseMap.getValue(rpm, engineLoad) + CONFIG(extraInjectionOffset);
fixAngle(result, "inj offset");
return result;