Initial introduction of a sync los counter
This commit is contained in:
parent
b14e2d41f4
commit
0b2cd0d88a
|
@ -158,7 +158,7 @@ void triggerPri_missingTooth()
|
|||
//Begin the missing tooth detection
|
||||
//If the time between the current tooth and the last is greater than 1.5x the time between the last tooth and the tooth before that, we make the assertion that we must be at the first tooth after the gap
|
||||
if(configPage4.triggerMissingTeeth == 1) { targetGap = (3 * (toothLastToothTime - toothLastMinusOneToothTime)) >> 1; } //Multiply by 1.5 (Checks for a gap 1.5x greater than the last one) (Uses bitshift to multiply by 3 then divide by 2. Much faster than multiplying by 1.5)
|
||||
else { targetGap = ((toothLastToothTime - toothLastMinusOneToothTime)) * 2; } //Multiply by 2 (Checks for a gap 2x greater than the last one)
|
||||
else { targetGap = ((toothLastToothTime - toothLastMinusOneToothTime)) * configPage4.triggerMissingTeeth; } //Multiply by 2 (Checks for a gap 2x greater than the last one)
|
||||
|
||||
if( (toothLastToothTime == 0) || (toothLastMinusOneToothTime == 0) ) { curGap = 0; }
|
||||
|
||||
|
|
|
@ -387,6 +387,7 @@ struct statuses {
|
|||
int16_t fuelLoad;
|
||||
int16_t ignLoad;
|
||||
bool fuelPumpOn; //The current status of the fuel pump
|
||||
byte syncLossCounter;
|
||||
|
||||
//Helpful bitwise operations:
|
||||
//Useful reference: http://playground.arduino.cc/Code/BitMath
|
||||
|
|
Loading…
Reference in New Issue