mirror of https://github.com/FOME-Tech/fome-fw.git
trigger refactoring: instance RPM #4740
This commit is contained in:
parent
e42939560f
commit
f7daa5df72
|
@ -127,7 +127,13 @@ static bool vvtWithRealDecoder(vvt_mode_e vvtMode) {
|
||||||
angle_t TriggerCentral::syncAndReport(int divider, int remainder) {
|
angle_t TriggerCentral::syncAndReport(int divider, int remainder) {
|
||||||
angle_t engineCycle = getEngineCycle(getEngineRotationState()->getOperationMode());
|
angle_t engineCycle = getEngineCycle(getEngineRotationState()->getOperationMode());
|
||||||
|
|
||||||
return triggerState.syncEnginePhase(divider, remainder, engineCycle);
|
angle_t totalShift = triggerState.syncEnginePhase(divider, remainder, engineCycle);
|
||||||
|
if (totalShift != 0) {
|
||||||
|
// Reset instant RPM, since the engine phase has now changed, invalidating the tooth history buffer
|
||||||
|
// maybe TODO: could/should we rotate the buffer around to re-align it instead? Is that worth it?
|
||||||
|
triggerState.instantRpm.resetInstantRpm();
|
||||||
|
}
|
||||||
|
return totalShift;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void turnOffAllDebugFields(void *arg) {
|
static void turnOffAllDebugFields(void *arg) {
|
||||||
|
|
|
@ -370,10 +370,6 @@ angle_t PrimaryTriggerDecoder::syncEnginePhase(int divider, int remainder, angle
|
||||||
|
|
||||||
if (totalShift > 0) {
|
if (totalShift > 0) {
|
||||||
camResyncCounter++;
|
camResyncCounter++;
|
||||||
|
|
||||||
// Reset instant RPM, since the engine phase has now changed, invalidating the tooth history buffer
|
|
||||||
// maybe TODO: could/should we rotate the buffer around to re-align it instead? Is that worth it?
|
|
||||||
instantRpm.resetInstantRpm();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return totalShift;
|
return totalShift;
|
||||||
|
|
Loading…
Reference in New Issue