SR20VE trigger

This commit is contained in:
rusefi 2017-03-18 21:36:51 -04:00
parent 0383e5a567
commit 29d13aa32a
2 changed files with 9 additions and 6 deletions

View File

@ -125,6 +125,15 @@ static trigger_value_e eventType[6] = { TV_FALL, TV_RISE, TV_FALL, TV_RISE, TV_F
totalEventCountBase += TRIGGER_SHAPE(size); \
}
#define considerEventForGap() (!TRIGGER_SHAPE(useOnlyPrimaryForSync) || isPrimary)
#define needToSkipRise(type) (!TRIGGER_SHAPE(gapBothDirections)) && ((!TRIGGER_SHAPE(useRiseEdge)) && (type != TV_FALL))
#define needToSkipFall(type) (!TRIGGER_SHAPE(gapBothDirections)) && ( TRIGGER_SHAPE(useRiseEdge) && (type != TV_RISE))
#define isLessImportant(type) (needToSkipFall(type) || needToSkipRise(type) || (!considerEventForGap()) )
/**
* @brief Trigger decoding happens here
* This method is invoked every time we have a fall or rise on one of the trigger sensors.

View File

@ -125,11 +125,5 @@ void initTriggerDecoderLogger(Logging *sharedLogger);
bool isTriggerDecoderError(void);
#define considerEventForGap() (!TRIGGER_SHAPE(useOnlyPrimaryForSync) || isPrimary)
#define isLessImportant(type) ((!TRIGGER_SHAPE(gapBothDirections)) && (TRIGGER_SHAPE(useRiseEdge) && (type != TV_RISE)) \
|| ((!TRIGGER_SHAPE(gapBothDirections)) && !TRIGGER_SHAPE(useRiseEdge) && (type != TV_FALL)) \
|| (!considerEventForGap()) \
)
#endif /* TRIGGER_DECODER_H_ */