2015-05-16 04:06:54 -07:00
volatile unsigned long curTime ;
volatile unsigned int curGap ;
2015-06-14 05:11:10 -07:00
volatile unsigned int lastGap ;
2015-05-16 04:06:54 -07:00
volatile unsigned int targetGap ;
volatile int toothCurrentCount = 0 ; //The current number of teeth (Onec sync has been achieved, this can never actually be 0
volatile unsigned long toothLastToothTime = 0 ; //The time (micros()) that the last tooth was registered
volatile unsigned long toothLastMinusOneToothTime = 0 ; //The time (micros()) that the tooth before the last tooth was registered
volatile unsigned long toothOneTime = 0 ; //The time (micros()) that tooth 1 last triggered
volatile unsigned long toothOneMinusOneTime = 0 ; //The 2nd to last time (micros()) that tooth 1 last triggered
volatile int toothHistory [ 512 ] ;
volatile int toothHistoryIndex = 0 ;
volatile int triggerActualTeeth ;
2015-05-22 02:54:13 -07:00
unsigned int triggerFilterTime ; // The shortest time (in uS) that pulses will be accepted (Used for debounce filtering)
unsigned int triggerToothAngle ; //The number of crank degrees that elapse per tooth
2015-06-11 20:18:36 -07:00
unsigned long revolutionTime ; //The time in uS that one revolution would take at current speed (The time tooth 1 was last seen, minus the time it was seen prior to that)