auto-sync

This commit is contained in:
rusEfi 2015-07-15 23:07:51 -04:00
parent 4f3ebbc3f6
commit ee066cb26f
4 changed files with 8 additions and 1 deletions

View File

@ -129,6 +129,8 @@ void TriggerState::decodeTriggerEvent(trigger_event_e const signal, efitime_t no
currentDuration =
currentDurationLong > 10 * US2NT(US_PER_SECOND_LL) ? 10 * US2NT(US_PER_SECOND_LL) : currentDurationLong;
bool_t isPrimary = triggerWheel == T_PRIMARY;
if (isLessImportant(signal)) {
#if EFI_UNIT_TEST
if (printTriggerDebug) {

View File

@ -105,7 +105,9 @@ void initTriggerDecoderLogger(Logging *sharedLogger);
bool_t isTriggerDecoderError(void);
#define isLessImportant(signal) ((TRIGGER_SHAPE(useRiseEdge) && signal != SHAFT_PRIMARY_UP) \
|| (!TRIGGER_SHAPE(useRiseEdge) && signal != SHAFT_PRIMARY_DOWN))
|| (!TRIGGER_SHAPE(useRiseEdge) && signal != SHAFT_PRIMARY_DOWN) \
|| (!isPrimary && TRIGGER_SHAPE(useOnlyPrimaryForSync)) \
)
#endif /* TRIGGER_DECODER_H_ */

View File

@ -39,6 +39,7 @@ TriggerShape::TriggerShape() :
wave.waves = h.waves;
// todo: false here, true in clear() what a mess!
useRiseEdge = false;
useOnlyPrimaryForSync = false;
gapBothDirections = false;
isSynchronizationNeeded = false;
// todo: reuse 'clear' method?

View File

@ -59,6 +59,8 @@ public:
* Should we use falls or rises for gap ratio detection?
*/
bool_t useRiseEdge;
bool_t useOnlyPrimaryForSync;
/**
* Should we measure gaps with events of both kinds?
*/