From 0174a98908287a2ad98f1e06b36096e9105bf6fa Mon Sep 17 00:00:00 2001 From: Josh Stewart Date: Fri, 1 Jan 2016 23:14:05 +1100 Subject: [PATCH] More fixes for Audi 135 and dual wheel --- decoders.ino | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/decoders.ino b/decoders.ino index 03703e3..11ca909 100644 --- a/decoders.ino +++ b/decoders.ino @@ -153,8 +153,10 @@ void triggerPri_DualWheel() curGap = curTime - toothLastToothTime; if ( curGap < triggerFilterTime ) { return; } //Debounce check. Pulses should never be less than triggerFilterTime, so if they are it means a false trigger. (A 36-1 wheel at 8000pm will have triggers approx. every 200uS) toothCurrentCount++; //Increment the tooth counter + addToothLogEntry(curGap); + if ( !currentStatus.hasSync ) { return; } - if ( toothCurrentCount == 1 || toothCurrentCount > configPage2.triggerTeeth) + if ( toothCurrentCount == 1 || toothCurrentCount > configPage2.triggerTeeth ) { toothCurrentCount = 1; toothOneMinusOneTime = toothOneTime; @@ -163,8 +165,6 @@ void triggerPri_DualWheel() //if ((startRevolutions & 63) == 1) { currentStatus.hasSync = false; } //Every 64 revolutions, force a resync with the cam } - addToothLogEntry(curGap); - toothLastMinusOneToothTime = toothLastToothTime; toothLastToothTime = curTime; } @@ -697,12 +697,14 @@ void triggerPri_Audi135() toothSystemCount++; toothSystemLastToothTime = curTime; addToothLogEntry(curGap); + if ( !currentStatus.hasSync ) { return; } if ( toothSystemCount != 3 ) { return; } //We only proceed for every third tooth toothSystemCount = 0; toothCurrentCount++; //Increment the tooth counter - if ( toothCurrentCount == 1 )// || toothCurrentCount > 45) + if ( toothCurrentCount == 1 || toothCurrentCount > 45 ) { + toothCurrentCount == 1; toothOneMinusOneTime = toothOneTime; toothOneTime = curTime; startRevolutions++; //Counter