Minor performance tweaks to Nissan 360

This commit is contained in:
Josh Stewart 2017-03-01 16:53:29 +11:00
parent 22af95db32
commit 7818d418d4
1 changed files with 3 additions and 4 deletions

View File

@ -1378,7 +1378,7 @@ void triggerSetup_Nissan360()
void triggerPri_Nissan360() void triggerPri_Nissan360()
{ {
curTime = micros(); curTime = micros();
curGap = curTime - toothLastToothTime; //curGap = curTime - toothLastToothTime;
//if ( curGap < triggerFilterTime ) { return; } //Pulses should never be less than triggerFilterTime, so if they are it means a false trigger. //if ( curGap < triggerFilterTime ) { return; } //Pulses should never be less than triggerFilterTime, so if they are it means a false trigger.
toothCurrentCount++; //Increment the tooth counter toothCurrentCount++; //Increment the tooth counter
//addToothLogEntry(curGap); Disable tooth logging on this decoder due to overhead //addToothLogEntry(curGap); Disable tooth logging on this decoder due to overhead
@ -1386,7 +1386,7 @@ void triggerPri_Nissan360()
toothLastMinusOneToothTime = toothLastToothTime; toothLastMinusOneToothTime = toothLastToothTime;
toothLastToothTime = curTime; toothLastToothTime = curTime;
if ( !currentStatus.hasSync ) { return; } //if ( !currentStatus.hasSync ) { return; }
if ( toothCurrentCount == 181) //1 complete crank revolution if ( toothCurrentCount == 181) //1 complete crank revolution
{ {
@ -1479,12 +1479,11 @@ void triggerSec_Nissan360()
currentStatus.hasSync = true; currentStatus.hasSync = true;
} }
} }
//else { currentStatus.hasSync = false; return ;} //This should really never happen else { currentStatus.hasSync = false; return ;} //This should really never happen
} }
else else
{ {
//Already have sync, but do a verify every 720 degrees. //Already have sync, but do a verify every 720 degrees.
//Not sure if this works for 6 cylinder???
if(configPage1.nCylinders == 4) if(configPage1.nCylinders == 4)
{ {
if(secondaryDuration >= 15) //Duration of window = 16 primary teeth if(secondaryDuration >= 15) //Duration of window = 16 primary teeth