From 8cf19d3d12d20017b61bb6e203d389a90b6a4cad Mon Sep 17 00:00:00 2001 From: rusefi Date: Tue, 29 Oct 2019 21:12:44 -0400 Subject: [PATCH] refactoring & verbose trigger to simulator --- firmware/controllers/trigger/trigger_decoder.cpp | 8 +++----- simulator/simulator/rusEfiFunctionalTest.cpp | 9 +++++++++ 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/firmware/controllers/trigger/trigger_decoder.cpp b/firmware/controllers/trigger/trigger_decoder.cpp index 905b99723d..1141b6a3ef 100644 --- a/firmware/controllers/trigger/trigger_decoder.cpp +++ b/firmware/controllers/trigger/trigger_decoder.cpp @@ -308,8 +308,6 @@ static trigger_value_e eventType[6] = { TV_FALL, TV_RISE, TV_FALL, TV_RISE, TV_F #define needToSkipFall(type) ((!TRIGGER_SHAPE(gapBothDirections)) && (( TRIGGER_SHAPE(useRiseEdge)) && (type != TV_RISE))) #define needToSkipRise(type) ((!TRIGGER_SHAPE(gapBothDirections)) && ((!TRIGGER_SHAPE(useRiseEdge)) && (type != TV_FALL))) -#define isLessImportant(type) (needToSkipFall(type) || needToSkipRise(type) || (!considerEventForGap()) ) - int TriggerState::getCurrentIndex() const { return currentCycle.current_index; } @@ -449,7 +447,7 @@ void TriggerState::decodeTriggerEvent(trigger_event_e const signal, efitime_t no bool isPrimary = triggerWheel == T_PRIMARY; - if (isLessImportant(type)) { + if (needToSkipFall(type) || needToSkipRise(type) || (!considerEventForGap())) { #if EFI_UNIT_TEST if (printTriggerDebug) { printf("%s isLessImportant %s now=%lld index=%d\r\n", @@ -552,7 +550,7 @@ void TriggerState::decodeTriggerEvent(trigger_event_e const signal, efitime_t no actualSynchGap = 1.0 * toothDurations[0] / toothDurations[1]; #endif /* EFI_UNIT_TEST */ -#if EFI_PROD_CODE +#if EFI_PROD_CODE || EFI_SIMULATOR if (CONFIG(verboseTriggerSynchDetails) || (someSortOfTriggerError && !silentTriggerError)) { for (int i = 0;isetConfig(config);