Idle air add via Lua fix #4465

This commit is contained in:
rusefillc 2022-08-21 00:32:34 -04:00
parent ab11a57e33
commit 6d634e3c6a
3 changed files with 7 additions and 0 deletions

View File

@ -99,6 +99,8 @@ percent_t IdleController::getRunningOpenLoop(float clt, SensorResult tps) {
running += enginePins.fanRelay.getLogicValue() ? engineConfiguration->fan1ExtraIdle : 0;
running += enginePins.fanRelay2.getLogicValue() ? engineConfiguration->fan2ExtraIdle : 0;
running += luaAdd;
// Now bump it by the specified amount when the throttle is opened (if configured)
// nb: invalid tps will make no change, no explicit check required
iacByTpsTaper = interpolateClamped(

View File

@ -365,6 +365,7 @@ void Engine::resetLua() {
#endif // EFI_BOOST_CONTROL
ignitionState.luaTimingAdd = 0;
ignitionState.luaTimingMult = 1;
engine->module<IdleController>().unmock().luaAdd = 0;
}
/**

View File

@ -683,6 +683,10 @@ void configureRusefiLuaHooks(lua_State* l) {
return 0;
});
#endif // EFI_BOOST_CONTROL
lua_register(l, "setIdleAdd", [](lua_State* l) {
engine->module<IdleController>().unmock().luaAdd = luaL_checknumber(l, 1);
return 0;
});
lua_register(l, "setTimingAdd", [](lua_State* l) {
engine->ignitionState.luaTimingAdd = luaL_checknumber(l, 1);
return 0;