diff --git a/firmware/CHANGELOG.md b/firmware/CHANGELOG.md index ffcb68b786..d0967b1dc8 100644 --- a/firmware/CHANGELOG.md +++ b/firmware/CHANGELOG.md @@ -35,6 +35,7 @@ Release template (copy/paste this for new release): - RPM correction/multiplier for Accel Enrich #4760 - Tooth logger writes to SD card #4897 - Antilag #2403 + - Lua 'setIgnDisabled' function for all kinds of cranking safety systems ## December 2022 Release - "Day 289" diff --git a/firmware/controllers/limp_manager.cpp b/firmware/controllers/limp_manager.cpp index 0b706fe902..11c78e4bc6 100644 --- a/firmware/controllers/limp_manager.cpp +++ b/firmware/controllers/limp_manager.cpp @@ -49,6 +49,10 @@ void LimpManager::updateState(int rpm, efitick_t nowNt) { } #endif + if (engine->engineState.lua.luaIgnCut) { + allowSpark.clear(ClearReason::Lua); + } + { // User-configured hard RPM limit, either constant or CLT-lookup // todo: migrate to engineState->desiredRpmLimit to get this variable logged diff --git a/firmware/controllers/lua/lua_hooks.cpp b/firmware/controllers/lua/lua_hooks.cpp index 7354c71e68..05c61cba2f 100644 --- a/firmware/controllers/lua/lua_hooks.cpp +++ b/firmware/controllers/lua/lua_hooks.cpp @@ -780,6 +780,10 @@ void configureRusefiLuaHooks(lua_State* l) { engine->engineState.lua.luaDisableEtb = lua_toboolean(l, 1); return 0; }); + lua_register(l, "setIgnDisabled", [](lua_State* l) { + engine->engineState.lua.luaIgnCut = lua_toboolean(l, 1); + return 0; + }); #endif // EFI_PROD_CODE lua_register(l, "setClutchUpState", [](lua_State* l) {