Skip to content

Commit

Permalink
KnockController: fix knock retard logic
Browse files Browse the repository at this point in the history
use method to determine maximum retard, versus the member which is unused (in favor of max knock retard table)
  • Loading branch information
nmschulte committed Mar 9, 2024
1 parent f4186c1 commit 468dc1e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion firmware/controllers/engine_cycle/knock_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}

Expand Down

0 comments on commit 468dc1e

Please sign in to comment.