better location for global fuel correction

This commit is contained in:
rusefi 2017-05-24 23:48:03 -04:00
parent 73afcd2a8b
commit 830e96e1f5
3 changed files with 3 additions and 3 deletions

View File

@ -376,7 +376,7 @@ void Engine::periodicFastCallback(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
engineState.periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE);
engine->m.beforeFuelCalc = GET_TIMESTAMP();
ENGINE(fuelMs) = getInjectionDuration(rpm PASS_ENGINE_PARAMETER_SUFFIX) * engineConfiguration->globalFuelCorrection;
ENGINE(fuelMs) = getInjectionDuration(rpm PASS_ENGINE_PARAMETER_SUFFIX);
engine->m.fuelCalcTime = GET_TIMESTAMP() - engine->m.beforeFuelCalc;
}

View File

@ -158,7 +158,7 @@ floatms_t getInjectionDuration(int rpm DECLARE_ENGINE_PARAMETER_SUFFIX) {
warning(CUSTOM_ERR_INJECTOR_LAG, "injectorLag not ready");
return 0; // we can end up here during configuration reset
}
return theoreticalInjectionLength + injectorLag;
return theoreticalInjectionLength * engineConfiguration->globalFuelCorrection + injectorLag;
}
floatms_t getRunningFuel(floatms_t baseFuel DECLARE_ENGINE_PARAMETER_SUFFIX) {

View File

@ -381,7 +381,7 @@ static ALWAYS_INLINE void handleFuel(const bool limitedFuel, uint32_t trgEventIn
ENGINE(tpsAccelEnrichment.onNewValue(getTPS(PASS_ENGINE_PARAMETER_SIGNATURE) PASS_ENGINE_PARAMETER_SUFFIX));
ENGINE(engineLoadAccelEnrichment.onEngineCycle(PASS_ENGINE_PARAMETER_SIGNATURE));
ENGINE(fuelMs) = getInjectionDuration(rpm PASS_ENGINE_PARAMETER_SUFFIX) * CONFIG(globalFuelCorrection);
ENGINE(fuelMs) = getInjectionDuration(rpm PASS_ENGINE_PARAMETER_SUFFIX);
for (int injEventIndex = 0; injEventIndex < CONFIG(specs.cylindersCount); injEventIndex++) {
InjectionEvent *event = &fs->elements[injEventIndex];