Skip to content

Commit

Permalink
synchronized Phase handling improvements fix rusefi#4099
Browse files Browse the repository at this point in the history
  • Loading branch information
rusefillc committed May 9, 2022
1 parent db3e48e commit 32d46d1
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
1 change: 1 addition & 0 deletions firmware/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 0 additions & 2 deletions firmware/controllers/trigger/trigger_decoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ void TriggerState::resetTriggerState() {
totalEventCountBase = 0;
isFirstEvent = true;

m_hasSynchronizedPhase = false;
synchronizedPhase.init();
}

Expand Down Expand Up @@ -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;
Expand Down
4 changes: 1 addition & 3 deletions firmware/controllers/trigger/trigger_decoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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;
};

Expand Down

0 comments on commit 32d46d1

Please sign in to comment.