better location for global fuel correction
This commit is contained in:
parent
7c50cc8734
commit
77715046f4
|
@ -376,7 +376,7 @@ void Engine::periodicFastCallback(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
engineState.periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE);
|
engineState.periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||||
|
|
||||||
engine->m.beforeFuelCalc = GET_TIMESTAMP();
|
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;
|
engine->m.fuelCalcTime = GET_TIMESTAMP() - engine->m.beforeFuelCalc;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -158,7 +158,7 @@ floatms_t getInjectionDuration(int rpm DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||||
warning(CUSTOM_ERR_INJECTOR_LAG, "injectorLag not ready");
|
warning(CUSTOM_ERR_INJECTOR_LAG, "injectorLag not ready");
|
||||||
return 0; // we can end up here during configuration reset
|
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) {
|
floatms_t getRunningFuel(floatms_t baseFuel DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||||
|
|
|
@ -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(tpsAccelEnrichment.onNewValue(getTPS(PASS_ENGINE_PARAMETER_SIGNATURE) PASS_ENGINE_PARAMETER_SUFFIX));
|
||||||
ENGINE(engineLoadAccelEnrichment.onEngineCycle(PASS_ENGINE_PARAMETER_SIGNATURE));
|
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++) {
|
for (int injEventIndex = 0; injEventIndex < CONFIG(specs.cylindersCount); injEventIndex++) {
|
||||||
InjectionEvent *event = &fs->elements[injEventIndex];
|
InjectionEvent *event = &fs->elements[injEventIndex];
|
||||||
|
|
Loading…
Reference in New Issue