diff --git a/firmware/controllers/actuators/vvt.cpp b/firmware/controllers/actuators/vvt.cpp index 8f6a896033..44e2b05d59 100644 --- a/firmware/controllers/actuators/vvt.cpp +++ b/firmware/controllers/actuators/vvt.cpp @@ -39,11 +39,13 @@ void VvtController::onFastCallback() { return; } - if (engine->vvtParametersVersion.isOld(engine->getGlobalConfigurationVersion())) { + update(); +} + +void VvtController::onConfigurationChange(engine_configuration_s const * previousConfig) { + if (!m_pid.isSame(&previousConfig->auxPid[index])) { m_pid.reset(); } - - update(); } expected VvtController::observePlant() const { diff --git a/firmware/controllers/actuators/vvt.h b/firmware/controllers/actuators/vvt.h index ef97d4ee6d..81ebdb610e 100644 --- a/firmware/controllers/actuators/vvt.h +++ b/firmware/controllers/actuators/vvt.h @@ -28,6 +28,7 @@ public: // EngineModule implementation void onFastCallback() override; + void onConfigurationChange(engine_configuration_s const * previousConfig) override; // ClosedLoopController implementation expected observePlant() const override; diff --git a/firmware/controllers/algo/engine.h b/firmware/controllers/algo/engine.h index eca17f64b8..23b5c02268 100644 --- a/firmware/controllers/algo/engine.h +++ b/firmware/controllers/algo/engine.h @@ -219,7 +219,6 @@ public: void setConfig(); LocalVersionHolder versionForConfigurationListeners; - LocalVersionHolder vvtParametersVersion; AuxActor auxValves[AUX_DIGITAL_VALVE_COUNT][2];