From 0b21ddce9cc144a21935f8f120ae9f0b7fe11867 Mon Sep 17 00:00:00 2001 From: rusefillc Date: Sat, 16 Apr 2022 16:39:52 -0400 Subject: [PATCH] random progress --- firmware/controllers/actuators/vvt.cpp | 4 ++++ firmware/controllers/engine_cycle/rpm_calculator.cpp | 4 +++- firmware/controllers/lua/lua_hooks.cpp | 2 ++ firmware/controllers/math/closed_loop_fuel.cpp | 4 ++++ 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/firmware/controllers/actuators/vvt.cpp b/firmware/controllers/actuators/vvt.cpp index e824f26dbc..54ffdedd1c 100644 --- a/firmware/controllers/actuators/vvt.cpp +++ b/firmware/controllers/actuators/vvt.cpp @@ -46,7 +46,11 @@ void VvtController::PeriodicTask() { } expected VvtController::observePlant() const { +#if EFI_SHAFT_POSITION_INPUT return engine->triggerCentral.getVVTPosition(m_bank, m_cam); +#else + return unexpected; +#endif // EFI_SHAFT_POSITION_INPUT } expected VvtController::getSetpoint() { diff --git a/firmware/controllers/engine_cycle/rpm_calculator.cpp b/firmware/controllers/engine_cycle/rpm_calculator.cpp index 840ed27b9f..f783851285 100644 --- a/firmware/controllers/engine_cycle/rpm_calculator.cpp +++ b/firmware/controllers/engine_cycle/rpm_calculator.cpp @@ -381,7 +381,9 @@ efitick_t scheduleByAngle(scheduling_s *timer, efitick_t edgeTimestamp, angle_t } #else -RpmCalculator::RpmCalculator() { +RpmCalculator::RpmCalculator() : + StoredValueSensor(SensorType::Rpm, 0) +{ } diff --git a/firmware/controllers/lua/lua_hooks.cpp b/firmware/controllers/lua/lua_hooks.cpp index 43cdebe10b..591a7bcbb6 100644 --- a/firmware/controllers/lua/lua_hooks.cpp +++ b/firmware/controllers/lua/lua_hooks.cpp @@ -562,6 +562,7 @@ void configureRusefiLuaHooks(lua_State* l) { return 1; }); +#if EFI_SHAFT_POSITION_INPUT lua_register(l, "getEngineState", [](lua_State* l) { spinning_state_e state = engine->rpmCalculator.getState(); int luaStateCode; @@ -576,6 +577,7 @@ void configureRusefiLuaHooks(lua_State* l) { lua_pushnumber(l, luaStateCode); return 1; }); +#endif //EFI_SHAFT_POSITION_INPUT lua_register(l, "setCalibration", [](lua_State* l) { auto propertyName = luaL_checklstring(l, 1, nullptr); diff --git a/firmware/controllers/math/closed_loop_fuel.cpp b/firmware/controllers/math/closed_loop_fuel.cpp index f5ff19892b..eb37d34b81 100644 --- a/firmware/controllers/math/closed_loop_fuel.cpp +++ b/firmware/controllers/math/closed_loop_fuel.cpp @@ -46,6 +46,7 @@ size_t computeStftBin(int rpm, float load, stft_s& cfg) { } static bool shouldCorrect() { +#if EFI_SHAFT_POSITION_INPUT const auto& cfg = engineConfiguration->stft; // User disable bit @@ -71,6 +72,9 @@ static bool shouldCorrect() { // If all was well, then we're enabled! return true; +#else + return false; +#endif // EFI_SHAFT_POSITION_INPUT } bool shouldUpdateCorrection(SensorType sensor) {