diff --git a/firmware/CHANGELOG.md b/firmware/CHANGELOG.md index 189db6e28e..03a430f1cd 100644 --- a/firmware/CHANGELOG.md +++ b/firmware/CHANGELOG.md @@ -28,6 +28,7 @@ Release template (copy/paste this for new release): ### Added - raw voltage gauges for Lua script aux analog inputs #4346 - microRusEFI and Proteus F4 have CAN OpenBLT bootloader #4199 #4230 + - counter-noise measure for custom skipped trigger wheels #4375 ### Fixed - Lua CAN reception fixed for 11-bit IDs where the frame would be received, but a corrupt ID was passed to the handler function. #4321 diff --git a/firmware/controllers/trigger/decoders/trigger_universal.cpp b/firmware/controllers/trigger/decoders/trigger_universal.cpp index dc62b4d8a4..5aac78acaa 100644 --- a/firmware/controllers/trigger/decoders/trigger_universal.cpp +++ b/firmware/controllers/trigger/decoders/trigger_universal.cpp @@ -48,6 +48,10 @@ void initializeSkippedToothTriggerWaveformExt(TriggerWaveform *s, int totalTeeth #endif // EFI_UNIT_TEST s->setTriggerSynchronizationGap(skippedCount + 1); + if (totalTeethCount > 6 && skippedCount > 0) { + // this gap is not required to synch on perfect signal but is needed to handle to reject cranking transition noise and potentially high rev noise as well + s->setSecondTriggerSynchronizationGap(1); + } s->shapeWithoutTdc = (totalTeethCount > 1) && (skippedCount == 0); s->isSynchronizationNeeded = (totalTeethCount > 2) && (skippedCount != 0); diff --git a/unit_tests/tests/tests.mk b/unit_tests/tests/tests.mk index a57b720264..c4f370286e 100644 --- a/unit_tests/tests/tests.mk +++ b/unit_tests/tests/tests.mk @@ -12,6 +12,7 @@ TESTS_SRC_CPP = \ tests/trigger/test_real_cranking_miata_NA.cpp \ tests/trigger/test_real_cranking_miata_na6.cpp \ tests/trigger/test_real_cranking_nissan_vq40.cpp \ + tests/trigger/test_trigger_skipped_wheel.cpp \ tests/trigger/test_real_volkswagen.cpp \ tests/trigger/test_real_nb2_cranking.cpp \ tests/trigger/test_real_gm_24x.cpp \