auto-sync
This commit is contained in:
parent
d71ad557a1
commit
c6f405f4e1
|
@ -157,11 +157,6 @@ void TriggerCentral::handleShaftSignal(trigger_event_e signal DECLARE_ENGINE_PAR
|
|||
*/
|
||||
triggerState.decodeTriggerEvent(signal, nowNt PASS_ENGINE_PARAMETER);
|
||||
|
||||
if (!triggerState.shaft_is_synchronized) {
|
||||
// we should not propagate event if we do not know where we are
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* If we only have a crank position sensor with four stroke, here we are extending crank revolutions with a 360 degree
|
||||
* cycle into a four stroke, 720 degrees cycle.
|
||||
|
@ -177,6 +172,11 @@ void TriggerCentral::handleShaftSignal(trigger_event_e signal DECLARE_ENGINE_PAR
|
|||
}
|
||||
reportEventToWaveChart(signal, triggerIndexForListeners PASS_ENGINE_PARAMETER);
|
||||
|
||||
if (!triggerState.shaft_is_synchronized) {
|
||||
// we should not propagate event if we do not know where we are
|
||||
return;
|
||||
}
|
||||
|
||||
if (triggerState.current_index >= TRIGGER_SHAPE(size)) {
|
||||
warning(OBD_PCM_Processor_Fault, "unexpected eventIndex=%d", triggerState.current_index);
|
||||
} else {
|
||||
|
|
|
@ -20,6 +20,7 @@ typedef void (*ShaftPositionListener)(trigger_event_e signal, uint32_t index DEC
|
|||
|
||||
#define HW_EVENT_TYPES 6
|
||||
|
||||
// todo: maybe merge TriggerCentral and TriggerState classes into one class?
|
||||
class TriggerCentral {
|
||||
public:
|
||||
TriggerCentral();
|
||||
|
|
Loading…
Reference in New Issue