auto-sync

This commit is contained in:
rusEfi 2015-07-15 20:01:33 -04:00
parent d71ad557a1
commit c6f405f4e1
2 changed files with 6 additions and 5 deletions

View File

@ -157,11 +157,6 @@ void TriggerCentral::handleShaftSignal(trigger_event_e signal DECLARE_ENGINE_PAR
*/ */
triggerState.decodeTriggerEvent(signal, nowNt PASS_ENGINE_PARAMETER); 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 * 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. * 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); 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)) { if (triggerState.current_index >= TRIGGER_SHAPE(size)) {
warning(OBD_PCM_Processor_Fault, "unexpected eventIndex=%d", triggerState.current_index); warning(OBD_PCM_Processor_Fault, "unexpected eventIndex=%d", triggerState.current_index);
} else { } else {

View File

@ -20,6 +20,7 @@ typedef void (*ShaftPositionListener)(trigger_event_e signal, uint32_t index DEC
#define HW_EVENT_TYPES 6 #define HW_EVENT_TYPES 6
// todo: maybe merge TriggerCentral and TriggerState classes into one class?
class TriggerCentral { class TriggerCentral {
public: public:
TriggerCentral(); TriggerCentral();