45 #error "Total number of teeth not defined!"
48 #error "Number of missing teeth not defined!"
50 #ifndef NUMBER_OF_WHEEL_EVENTS
51 #error "Number of wheel events not defined"
77 unsigned char PTITCurrentState =
PTIT;
86 if(
TFLGOF && !(edgeTimeStamp & 0x8000)){
91 unsigned long thisEventTimeStamp = timeStamp.
timeLong;
93 if(PTITCurrentState & 0x01){
95 unsigned char lastEvent = 0;
96 unsigned long thisInterEventPeriod = 0;
102 unsigned long larger;
103 unsigned long smaller;
104 unsigned char thisLargerThanLast;
106 larger = thisInterEventPeriod;
108 thisLargerThanLast = 1;
111 smaller = thisInterEventPeriod;
112 thisLargerThanLast = 0;
125 unsigned long idealWide = 0;
126 unsigned long idealBackward = 0;
127 if(larger < (smaller + tolerance)){
131 if((larger < (idealWide + tolerance)) && (larger > (idealWide - tolerance))){
132 if(thisLargerThanLast){
139 if((larger < (idealBackward + tolerance)) && (larger > (idealBackward - tolerance))){
140 if(thisLargerThanLast){
145 }
else if(larger > (idealWide + tolerance)){
146 if(thisLargerThanLast){
226 unsigned short thisTicksPerDegree = 0;
229 if(initialOkToSchedule){
237 unsigned short thisAngle = 0;
246 unsigned short ratioBetweenThisAndLast = (
unsigned short)(((
unsigned long)
lastTicksPerDegree * 1000) / thisTicksPerDegree);
257 if(initialOkToSchedule){
258 SCHEDULE_ECT_OUTPUTS();
297 #include "../inc/defaultSecondaryRPMISR.c"