diff --git a/firmware/controllers/trigger/trigger_decoder.cpp b/firmware/controllers/trigger/trigger_decoder.cpp index 5e2310bbba..6f52263307 100644 --- a/firmware/controllers/trigger/trigger_decoder.cpp +++ b/firmware/controllers/trigger/trigger_decoder.cpp @@ -268,12 +268,6 @@ void TriggerState::decodeTriggerEvent(trigger_event_e const signal, efitime_t no } -// isGapCondition[1] = cisnan(TRIGGER_SHAPE(syncronizationRatioFrom[1])) || (toothDurations[1] > toothDurations[2] * TRIGGER_SHAPE(syncronizationRatioFrom[1]) -// && toothDurations[1] < toothDurations[2] * TRIGGER_SHAPE(syncronizationRatioTo[1])); -// -// isGapCondition[2] = cisnan(TRIGGER_SHAPE(syncronizationRatioFrom[2])) || (toothDurations[2] > toothDurations[3] * TRIGGER_SHAPE(syncronizationRatioFrom[2]) -// && toothDurations[2] < toothDurations[3] * TRIGGER_SHAPE(syncronizationRatioTo[2])); - /** * Here I prefer to have two multiplications instead of one division, that's a micro-optimization */ diff --git a/firmware/controllers/trigger/trigger_structure.cpp b/firmware/controllers/trigger/trigger_structure.cpp index 6cea83385b..7cc38e299a 100644 --- a/firmware/controllers/trigger/trigger_structure.cpp +++ b/firmware/controllers/trigger/trigger_structure.cpp @@ -103,13 +103,12 @@ void TriggerShape::initialize(operation_mode_e operationMode, bool needSecondTri memset(expectedDutyCycle, 0, sizeof(expectedDutyCycle)); memset(eventAngles, 0, sizeof(eventAngles)); // memset(triggerIndexByAngle, 0, sizeof(triggerIndexByAngle)); + setTriggerSynchronizationGap(2); - - syncronizationRatioFrom[1] = NAN; // NaN means do not use this ratio - syncronizationRatioTo[1] = 100000; - syncronizationRatioFrom[2] = NAN; // NaN means do not use this ratio - syncronizationRatioTo[2] = 100000; - + for (int index = 1; index < GAP_TRACKING_LENGHT ; index++) { + // NaN means do not use this gap ratio + setTriggerSynchronizationGap3(index, NAN, 100000); + } tdcPosition = 0; shapeDefinitionError = useOnlyPrimaryForSync = false;