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