From 468dc1ef329c434504bc1fb2729134483cb8b977 Mon Sep 17 00:00:00 2001 From: Nathan Schulte Date: Fri, 8 Mar 2024 18:31:17 -0600 Subject: [PATCH] KnockController: fix knock retard logic use method to determine maximum retard, versus the member which is unused (in favor of max knock retard table) --- firmware/controllers/engine_cycle/knock_controller.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firmware/controllers/engine_cycle/knock_controller.cpp b/firmware/controllers/engine_cycle/knock_controller.cpp index eef94df816..684b6170dc 100644 --- a/firmware/controllers/engine_cycle/knock_controller.cpp +++ b/firmware/controllers/engine_cycle/knock_controller.cpp @@ -74,7 +74,7 @@ bool KnockControllerBase::onKnockSenseCompleted(uint8_t cylinderNumber, float db // Adjust knock retard under lock chibios_rt::CriticalSectionLocker csl; auto newRetard = m_knockRetard + retardAmount; - m_knockRetard = clampF(0, newRetard, m_maximumRetard); + m_knockRetard = clampF(0, newRetard, getMaximumRetard()); } }