mirror of https://github.com/rusefi/rusefi-1.git
refactoring trigger sync layer
This commit is contained in:
parent
5138d5c3c8
commit
0c19b11263
|
@ -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
|
* Here I prefer to have two multiplications instead of one division, that's a micro-optimization
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -103,13 +103,12 @@ void TriggerShape::initialize(operation_mode_e operationMode, bool needSecondTri
|
||||||
memset(expectedDutyCycle, 0, sizeof(expectedDutyCycle));
|
memset(expectedDutyCycle, 0, sizeof(expectedDutyCycle));
|
||||||
memset(eventAngles, 0, sizeof(eventAngles));
|
memset(eventAngles, 0, sizeof(eventAngles));
|
||||||
// memset(triggerIndexByAngle, 0, sizeof(triggerIndexByAngle));
|
// memset(triggerIndexByAngle, 0, sizeof(triggerIndexByAngle));
|
||||||
|
|
||||||
setTriggerSynchronizationGap(2);
|
setTriggerSynchronizationGap(2);
|
||||||
|
for (int index = 1; index < GAP_TRACKING_LENGHT ; index++) {
|
||||||
syncronizationRatioFrom[1] = NAN; // NaN means do not use this ratio
|
// NaN means do not use this gap ratio
|
||||||
syncronizationRatioTo[1] = 100000;
|
setTriggerSynchronizationGap3(index, NAN, 100000);
|
||||||
syncronizationRatioFrom[2] = NAN; // NaN means do not use this ratio
|
}
|
||||||
syncronizationRatioTo[2] = 100000;
|
|
||||||
|
|
||||||
|
|
||||||
tdcPosition = 0;
|
tdcPosition = 0;
|
||||||
shapeDefinitionError = useOnlyPrimaryForSync = false;
|
shapeDefinitionError = useOnlyPrimaryForSync = false;
|
||||||
|
|
Loading…
Reference in New Issue