Trigger performance: variable gapTrackingLength #1851
cool change but looks to have made zero difference
This commit is contained in:
parent
47e094d70c
commit
348b387483
|
@ -83,6 +83,7 @@ void TriggerWaveform::initialize(operation_mode_e operationMode) {
|
||||||
// NaN means do not use this gap ratio
|
// NaN means do not use this gap ratio
|
||||||
setTriggerSynchronizationGap3(gapIndex, NAN, 100000);
|
setTriggerSynchronizationGap3(gapIndex, NAN, 100000);
|
||||||
}
|
}
|
||||||
|
gapTrackingLength = 1;
|
||||||
|
|
||||||
tdcPosition = 0;
|
tdcPosition = 0;
|
||||||
shapeDefinitionError = useOnlyPrimaryForSync = false;
|
shapeDefinitionError = useOnlyPrimaryForSync = false;
|
||||||
|
@ -335,6 +336,7 @@ void TriggerWaveform::setTriggerSynchronizationGap3(int gapIndex, float syncRati
|
||||||
// we have a special case here - only sync with one gap has this feature
|
// we have a special case here - only sync with one gap has this feature
|
||||||
this->syncRatioAvg = (int)efiRound((syncRatioFrom + syncRatioTo) * 0.5f, 1.0f);
|
this->syncRatioAvg = (int)efiRound((syncRatioFrom + syncRatioTo) * 0.5f, 1.0f);
|
||||||
}
|
}
|
||||||
|
gapTrackingLength = maxI(1 + gapIndex, gapTrackingLength);
|
||||||
|
|
||||||
#if EFI_UNIT_TEST
|
#if EFI_UNIT_TEST
|
||||||
if (printTriggerDebug) {
|
if (printTriggerDebug) {
|
||||||
|
|
|
@ -86,6 +86,10 @@ public:
|
||||||
* one primary channel tooth each raising (or falling depending on configuration) front would synchronize
|
* one primary channel tooth each raising (or falling depending on configuration) front would synchronize
|
||||||
*/
|
*/
|
||||||
bool isSynchronizationNeeded;
|
bool isSynchronizationNeeded;
|
||||||
|
/**
|
||||||
|
* number of consecutive trigger gaps needed to synchronize
|
||||||
|
*/
|
||||||
|
int gapTrackingLength = 1;
|
||||||
/**
|
/**
|
||||||
* special case for triggers which do not provide exact TDC location
|
* special case for triggers which do not provide exact TDC location
|
||||||
* For example pick-up in distributor with mechanical ignition firing order control.
|
* For example pick-up in distributor with mechanical ignition firing order control.
|
||||||
|
|
|
@ -532,7 +532,7 @@ void TriggerState::decodeTriggerEvent(
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isSync = true;
|
bool isSync = true;
|
||||||
for (int i = 0;i<GAP_TRACKING_LENGTH;i++) {
|
for (int i = 0;i<triggerShape->gapTrackingLength;i++) {
|
||||||
bool isGapCondition = cisnan(triggerShape->syncronizationRatioFrom[i]) || (toothDurations[i] > toothDurations[i + 1] * triggerShape->syncronizationRatioFrom[i]
|
bool isGapCondition = cisnan(triggerShape->syncronizationRatioFrom[i]) || (toothDurations[i] > toothDurations[i + 1] * triggerShape->syncronizationRatioFrom[i]
|
||||||
&& toothDurations[i] < toothDurations[i + 1] * triggerShape->syncronizationRatioTo[i]);
|
&& toothDurations[i] < toothDurations[i + 1] * triggerShape->syncronizationRatioTo[i]);
|
||||||
|
|
||||||
|
@ -558,7 +558,7 @@ void TriggerState::decodeTriggerEvent(
|
||||||
|
|
||||||
#if EFI_PROD_CODE || EFI_SIMULATOR
|
#if EFI_PROD_CODE || EFI_SIMULATOR
|
||||||
if (triggerConfiguration->isVerboseTriggerSynchDetails() || (someSortOfTriggerError && !silentTriggerError)) {
|
if (triggerConfiguration->isVerboseTriggerSynchDetails() || (someSortOfTriggerError && !silentTriggerError)) {
|
||||||
for (int i = 0;i<GAP_TRACKING_LENGTH;i++) {
|
for (int i = 0;i<triggerShape->gapTrackingLength;i++) {
|
||||||
float ratioFrom = triggerShape->syncronizationRatioFrom[i];
|
float ratioFrom = triggerShape->syncronizationRatioFrom[i];
|
||||||
if (cisnan(ratioFrom)) {
|
if (cisnan(ratioFrom)) {
|
||||||
// we do not track gap at this depth
|
// we do not track gap at this depth
|
||||||
|
@ -585,7 +585,7 @@ void TriggerState::decodeTriggerEvent(
|
||||||
#else
|
#else
|
||||||
if (printTriggerTrace) {
|
if (printTriggerTrace) {
|
||||||
float gap = 1.0 * toothDurations[0] / toothDurations[1];
|
float gap = 1.0 * toothDurations[0] / toothDurations[1];
|
||||||
for (int i = 0;i<GAP_TRACKING_LENGTH;i++) {
|
for (int i = 0;i<triggerShape->gapTrackingLength;i++) {
|
||||||
float gap = 1.0 * toothDurations[i] / toothDurations[i + 1];
|
float gap = 1.0 * toothDurations[i] / toothDurations[i + 1];
|
||||||
print("index=%d: gap=%.2f expected from %.2f to %.2f error=%s\r\n",
|
print("index=%d: gap=%.2f expected from %.2f to %.2f error=%s\r\n",
|
||||||
i,
|
i,
|
||||||
|
@ -659,7 +659,7 @@ void TriggerState::decodeTriggerEvent(
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = GAP_TRACKING_LENGTH; i > 0; i--) {
|
for (int i = triggerShape->gapTrackingLength; i > 0; i--) {
|
||||||
toothDurations[i] = toothDurations[i - 1];
|
toothDurations[i] = toothDurations[i - 1];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue