diff --git a/firmware/console/binary/live_data.cpp b/firmware/console/binary/live_data.cpp index 4f84ede2aa..1fb0e5eddb 100644 --- a/firmware/console/binary/live_data.cpp +++ b/firmware/console/binary/live_data.cpp @@ -101,7 +101,11 @@ const tps_accel_state_s* getLiveData(size_t) { template<> const trigger_central_s* getLiveData(size_t) { +#if EFI_SHAFT_POSITION_INPUT return &engine->triggerCentral; +#else + return nullptr; +#endif } template<> diff --git a/firmware/controllers/actuators/electronic_throttle.cpp b/firmware/controllers/actuators/electronic_throttle.cpp index 1a56158c63..f55a1fd1af 100644 --- a/firmware/controllers/actuators/electronic_throttle.cpp +++ b/firmware/controllers/actuators/electronic_throttle.cpp @@ -606,10 +606,12 @@ void EtbController::update() { } TpsState localReason = TpsState::None; - if (engineConfiguration->disableEtbWhenEngineStopped && !engine->triggerCentral.engineMovedRecently()) { - localReason = TpsState::EngineStopped; - } else if (etbTpsErrorCounter > 50) { + if (etbTpsErrorCounter > 50) { localReason = TpsState::IntermittentTps; +#if EFI_SHAFT_POSITION_INPUT + } else if (engineConfiguration->disableEtbWhenEngineStopped && !engine->triggerCentral.engineMovedRecently()) { + localReason = TpsState::EngineStopped; +#endif // EFI_SHAFT_POSITION_INPUT } else if (etbPpsErrorCounter > 50) { localReason = TpsState::IntermittentPps; } else if (engine->engineState.lua.luaDisableEtb) { diff --git a/firmware/controllers/algo/advance_map.cpp b/firmware/controllers/algo/advance_map.cpp index 3539782f7c..557825cad6 100644 --- a/firmware/controllers/algo/advance_map.cpp +++ b/firmware/controllers/algo/advance_map.cpp @@ -104,9 +104,11 @@ angle_t getAdvanceCorrections(int rpm) { ); } +#if EFI_SHAFT_POSITION_INPUT float instantRpm = engine->triggerCentral.instantRpm.getInstantRpm(); engine->engineState.timingPidCorrection = engine->module()->getIdleTimingAdjustment(instantRpm); +#endif // EFI_SHAFT_POSITION_INPUT #if EFI_TUNER_STUDIO engine->outputChannels.multiSparkCounter = engine->engineState.multispark.count; diff --git a/firmware/controllers/lua/lua_hooks.cpp b/firmware/controllers/lua/lua_hooks.cpp index 30b3834a18..ba350135d3 100644 --- a/firmware/controllers/lua/lua_hooks.cpp +++ b/firmware/controllers/lua/lua_hooks.cpp @@ -680,7 +680,7 @@ void configureRusefiLuaHooks(lua_State* l) { }); #endif // EFI_LAUNCH_CONTROL -#if !EFI_UNIT_TEST +#if EFI_SHAFT_POSITION_INPUT && !EFI_UNIT_TEST lua_register(l, "selfStimulateRPM", [](lua_State* l) { auto rpm = luaL_checkinteger(l, 1); if (rpm < 1) { @@ -872,13 +872,13 @@ void configureRusefiLuaHooks(lua_State* l) { doScheduleStopEngine(); return 0; }); - +#if EFI_SHAFT_POSITION_INPUT lua_register(l, "getTimeSinceTriggerEventMs", [](lua_State* l) { int result = engine->triggerCentral.m_lastEventTimer.getElapsedUs() / 1000; lua_pushnumber(l, result); return 1; }); - +#endif // EFI_SHAFT_POSITION_INPUT #if EFI_CAN_SUPPORT lua_register(l, "canRxAdd", lua_canRxAdd); diff --git a/firmware/controllers/math/engine_math.cpp b/firmware/controllers/math/engine_math.cpp index 8d231e4c55..4e247035fd 100644 --- a/firmware/controllers/math/engine_math.cpp +++ b/firmware/controllers/math/engine_math.cpp @@ -410,7 +410,9 @@ void prepareOutputSignals() { } #endif /* EFI_UNIT_TEST */ +#if EFI_SHAFT_POSITION_INPUT engine->triggerCentral.prepareTriggerShape(); +#endif // EFI_SHAFT_POSITION_INPUT // Fuel schedule may now be completely wrong, force a reset engine->injectionEvents.invalidate();