Add protection for possible interrupt clash on 4g63 (Rare issue)
This commit is contained in:
parent
7d32be4317
commit
756b048e5a
|
@ -451,11 +451,13 @@ int getRPM_4G63()
|
|||
//Because these signals aren't even (Alternativing 110 and 70 degrees), this needs a special function
|
||||
if(currentStatus.RPM < configPage2.crankRPM)
|
||||
{
|
||||
int tempToothAngle;
|
||||
noInterrupts();
|
||||
tempToothAngle = triggerToothAngle;
|
||||
revolutionTime = (toothLastToothTime - toothLastMinusOneToothTime); //Note that trigger tooth angle changes between 70 and 110 depending on the last tooth that was seen
|
||||
interrupts();
|
||||
revolutionTime = revolutionTime * 36;
|
||||
return (triggerToothAngle * 60000000L) / revolutionTime;
|
||||
return (tempToothAngle * 60000000L) / revolutionTime;
|
||||
}
|
||||
else { return stdGetRPM(); }
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue