diff --git a/firmware/controllers/trigger/decoders/trigger_misc.cpp b/firmware/controllers/trigger/decoders/trigger_misc.cpp index 8212d8e5bc..4a2c6f8cce 100644 --- a/firmware/controllers/trigger/decoders/trigger_misc.cpp +++ b/firmware/controllers/trigger/decoders/trigger_misc.cpp @@ -6,6 +6,7 @@ */ #include "trigger_misc.h" +#include "trigger_universal.h" // TT_FIAT_IAW_P8 void configureFiatIAQ_P8(TriggerWaveform * s) { @@ -22,6 +23,33 @@ void configureFiatIAQ_P8(TriggerWaveform * s) { s->setTriggerSynchronizationGap(3); } +// TT_TRI_TACH +void configureTriTach(TriggerWaveform * s) { + s->initialize(FOUR_STROKE_CRANK_SENSOR); + + s->isSynchronizationNeeded = false; + + float toothWidth = 0.5; + + float engineCycle = FOUR_STROKE_ENGINE_CYCLE; + + int totalTeethCount = 135; + float offset = 0; + + float angleDown = engineCycle / totalTeethCount * (0 + (1 - toothWidth)); + float angleUp = engineCycle / totalTeethCount * (0 + 1); + s->addEventClamped(offset + angleDown, T_PRIMARY, TV_RISE, NO_LEFT_FILTER, NO_RIGHT_FILTER); + s->addEventClamped(offset + angleDown + 0.1, T_SECONDARY, TV_RISE, NO_LEFT_FILTER, NO_RIGHT_FILTER); + s->addEventClamped(offset + angleUp, T_PRIMARY, TV_FALL, NO_LEFT_FILTER, NO_RIGHT_FILTER); + s->addEventClamped(offset + angleUp + 0.1, T_SECONDARY, TV_FALL, NO_LEFT_FILTER, NO_RIGHT_FILTER); + + + addSkippedToothTriggerEvents(T_SECONDARY, s, totalTeethCount, /* skipped */ 0, toothWidth, offset, engineCycle, + 1.5 * FOUR_STROKE_ENGINE_CYCLE / 135, NO_RIGHT_FILTER); + + +} + void configureFordST170(TriggerWaveform * s) { s->initialize(FOUR_STROKE_CAM_SENSOR); s->isSynchronizationNeeded = true;