diff --git a/firmware/CHANGELOG.md b/firmware/CHANGELOG.md index 53c1e6bde8b..2c01e562729 100644 --- a/firmware/CHANGELOG.md +++ b/firmware/CHANGELOG.md @@ -30,6 +30,7 @@ Release template (copy/paste this for new release): ### Fixed - Make 36-2 trigger sync parameters more generous #4132 + - Synchronized Phase handling fixes #4099 ## April 20202 Release - "Day 58" diff --git a/firmware/controllers/trigger/trigger_decoder.cpp b/firmware/controllers/trigger/trigger_decoder.cpp index c2dae9d65d4..0c67a33c63b 100644 --- a/firmware/controllers/trigger/trigger_decoder.cpp +++ b/firmware/controllers/trigger/trigger_decoder.cpp @@ -81,7 +81,6 @@ void TriggerState::resetTriggerState() { totalEventCountBase = 0; isFirstEvent = true; - m_hasSynchronizedPhase = false; synchronizedPhase.init(); } @@ -409,7 +408,6 @@ angle_t TriggerState::syncEnginePhase(int divider, int remainder, angle_t engine } // Allow injection/ignition to happen, we've now fully sync'd the crank based on new cam information - m_hasSynchronizedPhase = true; synchronizedPhase.reset(); return totalShift; diff --git a/firmware/controllers/trigger/trigger_decoder.h b/firmware/controllers/trigger/trigger_decoder.h index d2e212a6c89..0ed0ce25998 100644 --- a/firmware/controllers/trigger/trigger_decoder.h +++ b/firmware/controllers/trigger/trigger_decoder.h @@ -160,7 +160,7 @@ class TriggerState : public trigger_state_s { // i.e. if we have enough VVT information to have full sync on // an indeterminite crank pattern bool hasSynchronizedPhase() const { - return m_hasSynchronizedPhase; + return !synchronizedPhase.hasElapsedSec(3); } private: @@ -173,8 +173,6 @@ class TriggerState : public trigger_state_s { bool isFirstEvent; - // todo: migrate from 'm_hasSynchronizedPhase' to 'synchronizedPhase' - bool m_hasSynchronizedPhase = false; Timer synchronizedPhase; };