refactoring trigger sync layer

This commit is contained in:
rusefi 2018-10-21 13:58:54 -04:00
parent 5138d5c3c8
commit 0c19b11263
2 changed files with 5 additions and 12 deletions

View File

@ -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
*/

View File

@ -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;