From 75b3530036afd6f64d5ccf0bacce22c5f32f6925 Mon Sep 17 00:00:00 2001 From: Josh Stewart Date: Fri, 1 Dec 2023 14:57:34 +1100 Subject: [PATCH] Hardcode tooth count for 36-2-2-2 decoder --- speeduino/decoders.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/speeduino/decoders.cpp b/speeduino/decoders.cpp index 5f66b2cd..00ed89f4 100644 --- a/speeduino/decoders.cpp +++ b/speeduino/decoders.cpp @@ -3506,7 +3506,7 @@ void triggerSetup_ThirtySixMinus222(void) { triggerToothAngle = 10; //The number of degrees that passes from tooth to tooth triggerActualTeeth = 30; //The number of physical teeth on the wheel. Doing this here saves us a calculation each time in the interrupt - triggerFilterTime = (int)(MICROS_PER_SEC / (MAX_RPM / 60U * configPage4.triggerTeeth)); //Trigger filter time is the shortest possible time (in uS) that there can be between crank teeth (ie at max RPM). Any pulses that occur faster than this time will be discarded as noise + triggerFilterTime = (int)(MICROS_PER_SEC / (MAX_RPM / 60U * 36)); //Trigger filter time is the shortest possible time (in uS) that there can be between crank teeth (ie at max RPM). Any pulses that occur faster than this time will be discarded as noise BIT_CLEAR(decoderState, BIT_DECODER_2ND_DERIV); BIT_CLEAR(decoderState, BIT_DECODER_IS_SEQUENTIAL); BIT_SET(decoderState, BIT_DECODER_HAS_SECONDARY); @@ -3686,7 +3686,7 @@ void triggerSetup_ThirtySixMinus21(void) { triggerToothAngle = 10; //The number of degrees that passes from tooth to tooth triggerActualTeeth = 33; //The number of physical teeth on the wheel. Doing this here saves us a calculation each time in the interrupt. Not Used - triggerFilterTime = (MICROS_PER_SEC / (MAX_RPM / 60U * configPage4.triggerTeeth)); //Trigger filter time is the shortest possible time (in uS) that there can be between crank teeth (ie at max RPM). Any pulses that occur faster than this time will be discarded as noise + triggerFilterTime = (MICROS_PER_SEC / (MAX_RPM / 60U * 36)); //Trigger filter time is the shortest possible time (in uS) that there can be between crank teeth (ie at max RPM). Any pulses that occur faster than this time will be discarded as noise BIT_CLEAR(decoderState, BIT_DECODER_2ND_DERIV); BIT_CLEAR(decoderState, BIT_DECODER_IS_SEQUENTIAL); BIT_SET(decoderState, BIT_DECODER_HAS_SECONDARY);