LUA FuelAdd update

(cherry picked from commit a54cdbb0771b1a48aa8e24bffbaf554e10d55f3a)
This commit is contained in:
TurboMarian 2022-10-28 12:06:55 +01:00 committed by rusefillc
parent d454763d29
commit 276713d24f
2 changed files with 2 additions and 1 deletions

View File

@ -279,6 +279,7 @@ void Engine::reset() {
void Engine::resetLua() {
// todo: https://github.com/rusefi/rusefi/issues/4308
engineState.lua = {};
engineState.lua.fuelAdd = 0;
engineState.lua.fuelMult = 1;
#if EFI_BOOST_CONTROL
boostController.resetLua();

View File

@ -154,7 +154,7 @@ void EngineState::periodicFastCallback() {
auto tps = Sensor::get(SensorType::Tps1);
updateTChargeK(rpm, tps.value_or(0));
float injectionMass = getInjectionMass(rpm);
float injectionMass = getInjectionMass(rpm) * engine->engineState.lua.fuelMult + engine->engineState.lua.fuelAdd;
auto clResult = fuelClosedLoopCorrection();
// Store the pre-wall wetting injection duration for scheduling purposes only, not the actual injection duration