From 43586d5348f29b0fd0fd36a532ce02433d7d877c Mon Sep 17 00:00:00 2001 From: rusefillc Date: Sun, 3 Jan 2021 13:34:00 -0500 Subject: [PATCH] Audi OEM 5-cyl trigger pattern aka "Tri-Tach" https://rusefi.com/forum/viewtopic.php?f=5&t=1912 --- firmware/controllers/trigger/decoders/trigger_misc.h | 1 + firmware/controllers/trigger/decoders/trigger_universal.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/firmware/controllers/trigger/decoders/trigger_misc.h b/firmware/controllers/trigger/decoders/trigger_misc.h index 4a63240dbf..a9e80eca09 100644 --- a/firmware/controllers/trigger/decoders/trigger_misc.h +++ b/firmware/controllers/trigger/decoders/trigger_misc.h @@ -12,4 +12,5 @@ void configureFiatIAQ_P8(TriggerWaveform * s); void configureDaihatsu4(TriggerWaveform * s); void configureFordST170(TriggerWaveform * s); +void configureTriTach(TriggerWaveform * s); diff --git a/firmware/controllers/trigger/decoders/trigger_universal.cpp b/firmware/controllers/trigger/decoders/trigger_universal.cpp index 16c74292f2..e2985fadb9 100644 --- a/firmware/controllers/trigger/decoders/trigger_universal.cpp +++ b/firmware/controllers/trigger/decoders/trigger_universal.cpp @@ -28,6 +28,7 @@ void addSkippedToothTriggerEvents(trigger_wheel_e wheel, TriggerWaveform *s, int float angleDown = engineCycle / totalTeethCount * (totalTeethCount - skippedCount - 1 + (1 - toothWidth)); s->addEventClamped(offset + angleDown, wheel, TV_RISE, filterLeft, filterRight); + // custom handling of last event in order to avoid rounding error s->addEventClamped(offset + engineCycle, wheel, TV_FALL, filterLeft, filterRight); }