From 93cf484081603b0313ea7f128832a5edc3ed38a1 Mon Sep 17 00:00:00 2001 From: Matthew Kennedy Date: Fri, 3 Nov 2023 15:32:07 -0700 Subject: [PATCH] vvt guard --- firmware/controllers/actuators/vvt.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/firmware/controllers/actuators/vvt.cpp b/firmware/controllers/actuators/vvt.cpp index 60ec1a48c6..4059645240 100644 --- a/firmware/controllers/actuators/vvt.cpp +++ b/firmware/controllers/actuators/vvt.cpp @@ -112,8 +112,9 @@ expected VvtController::getClosedLoop(angle_t target, angle_t observa } void VvtController::setOutput(expected outputValue) { - float rpm = Sensor::getOrZero(SensorType::Rpm); #if EFI_SHAFT_POSITION_INPUT + float rpm = Sensor::getOrZero(SensorType::Rpm); + bool enabled = rpm > engineConfiguration->vvtControlMinRpm && engine->rpmCalculator.getSecondsSinceEngineStart(getTimeNowNt()) > engineConfiguration->vvtActivationDelayMs / MS_PER_SECOND ;