diff --git a/firmware/config/engines/custom_engine.cpp b/firmware/config/engines/custom_engine.cpp index ec1aaaf498..3b498f16a9 100644 --- a/firmware/config/engines/custom_engine.cpp +++ b/firmware/config/engines/custom_engine.cpp @@ -888,7 +888,9 @@ void detectBoardType() { void fuelBenchMode() { engineConfiguration->cranking.rpm = 12000; +#if EFI_ENGINE_CONTROL setFlatInjectorLag(0); +#endif // EFI_ENGINE_CONTROL setTable(engineConfiguration->postCrankingFactor, 1.0f); setArrayValues(config->crankingFuelCoef, 1.0f); setArrayValues(config->crankingCycleCoef, 1.0f); diff --git a/firmware/controllers/actuators/boost_control.cpp b/firmware/controllers/actuators/boost_control.cpp index 5c3ab7fc02..79dc4b04c4 100644 --- a/firmware/controllers/actuators/boost_control.cpp +++ b/firmware/controllers/actuators/boost_control.cpp @@ -75,7 +75,7 @@ expected BoostController::getSetpoint() { efiAssert(ObdCode::OBD_PCM_Processor_Fault, m_closedLoopTargetMap != nullptr, "boost closed loop target", unexpected); float target = m_closedLoopTargetMap->getValue(rpm, driverIntent.Value); - +#if EFI_ENGINE_CONTROL // Add any blends if configured for (size_t i = 0; i < efi::size(config->boostClosedLoopBlends); i++) { auto result = calculateBlend(config->boostClosedLoopBlends[i], rpm, driverIntent.Value); @@ -86,6 +86,7 @@ expected BoostController::getSetpoint() { target += result.Value; } +#endif //EFI_ENGINE_CONTROL return target * luaTargetMult + luaTargetAdd; } @@ -107,6 +108,7 @@ expected BoostController::getOpenLoop(float target) { float openLoop = luaOpenLoopAdd + m_openLoopMap->getValue(rpm, driverIntent.Value); +#if EFI_ENGINE_CONTROL // Add any blends if configured for (size_t i = 0; i < efi::size(config->boostOpenLoopBlends); i++) { auto result = calculateBlend(config->boostOpenLoopBlends[i], rpm, driverIntent.Value); @@ -117,6 +119,7 @@ expected BoostController::getOpenLoop(float target) { openLoop += result.Value; } +#endif // EFI_ENGINE_CONTROL // Add gear-based adder auto gear = Sensor::getOrZero(SensorType::DetectedGear); @@ -181,9 +184,11 @@ void BoostController::setOutput(expected output) { m_pwm->setSimplePwmDutyCycle(duty); } +#if EFI_ELECTRONIC_THROTTLE_BODY // inject wastegate position into DC controllers, pretty weird workflow to be honest // todo: should it be DC controller pulling? setEtbWastegatePosition(boostOutput); +#endif // EFI_ELECTRONIC_THROTTLE_BODY } void BoostController::onFastCallback() { @@ -281,4 +286,4 @@ void initBoostCtrl() { #endif } -#endif +#endif // EFI_BOOST_CONTROL diff --git a/firmware/controllers/lua/lua_hooks.cpp b/firmware/controllers/lua/lua_hooks.cpp index 440a273431..4a2539043b 100644 --- a/firmware/controllers/lua/lua_hooks.cpp +++ b/firmware/controllers/lua/lua_hooks.cpp @@ -368,6 +368,7 @@ static int lua_setDebug(lua_State* l) { return 0; } +#if EFI_ENGINE_CONTROL static auto lua_getAirmassResolveMode(lua_State* l) { if (lua_gettop(l) == 0) { // zero args, return configured mode @@ -403,6 +404,7 @@ static int lua_setAirmass(lua_State* l) { return 0; } +#endif // EFI_ENGINE_CONTROL #endif // EFI_UNIT_TEST @@ -756,14 +758,14 @@ void configureRusefiLuaHooks(lua_State* lState) { return 0; }); -#if EFI_PROD_CODE +#if EFI_ELECTRONIC_THROTTLE_BODY && EFI_PROD_CODE lua_register(lState, "restartEtb", [](lua_State* l) { // this is about Lua sensor acting in place of real analog PPS sensor // todo: smarter implementation doInitElectronicThrottle(); return 0; }); -#endif // EFI_PROD_CODE +#endif // EFI_ELECTRONIC_THROTTLE_BODY // checksum stuff lua_register(lState, "crc8_j1850", [](lua_State* l) { @@ -812,7 +814,7 @@ void configureRusefiLuaHooks(lua_State* lState) { engine->engineState.lua.fuelMult = luaL_checknumber(l, 1); return 0; }); -#if EFI_PROD_CODE +#if EFI_ELECTRONIC_THROTTLE_BODY && EFI_PROD_CODE lua_register(lState, "setEtbAdd", [](lua_State* l) { auto luaAdjustment = luaL_checknumber(l, 1); @@ -820,6 +822,8 @@ void configureRusefiLuaHooks(lua_State* lState) { return 0; }); +#endif // EFI_ELECTRONIC_THROTTLE_BODY +#if EFI_PROD_CODE lua_register(lState, "setEtbDisabled", [](lua_State* l) { engine->engineState.lua.luaDisableEtb = lua_toboolean(l, 1); return 0; @@ -934,8 +938,10 @@ void configureRusefiLuaHooks(lua_State* lState) { lua_register(lState, "getDigital", lua_getDigital); lua_register(lState, "getAuxDigital", lua_getAuxDigital); lua_register(lState, "setDebug", lua_setDebug); +#if EFI_ENGINE_CONTROL lua_register(lState, "getAirmass", lua_getAirmass); lua_register(lState, "setAirmass", lua_setAirmass); +#endif // EFI_ENGINE_CONTROL lua_register(lState, "stopEngine", [](lua_State*) { doScheduleStopEngine(); diff --git a/firmware/controllers/shutdown_controller.cpp b/firmware/controllers/shutdown_controller.cpp index cc2a160b1f..6e1a2512af 100644 --- a/firmware/controllers/shutdown_controller.cpp +++ b/firmware/controllers/shutdown_controller.cpp @@ -7,7 +7,9 @@ void doScheduleStopEngine() { efiPrintf("Starting doScheduleStopEngine"); +#if EFI_ENGINE_CONTROL getLimpManager()->shutdownController.stopEngine(); +#endif // EFI_ENGINE_CONTROL // todo: initiate stepper motor parking // make sure we have stored all the info #if EFI_PROD_CODE