From 19b0f7e66e989699a709cdb1f50080734159b5cc Mon Sep 17 00:00:00 2001 From: rusefillc Date: Sun, 16 Oct 2022 12:10:58 -0400 Subject: [PATCH] triggerImage: todo: support symmetrical crank --- .../controllers/trigger/decoders/trigger_subaru.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/firmware/controllers/trigger/decoders/trigger_subaru.cpp b/firmware/controllers/trigger/decoders/trigger_subaru.cpp index e3ed1b264b..85631bba68 100644 --- a/firmware/controllers/trigger/decoders/trigger_subaru.cpp +++ b/firmware/controllers/trigger/decoders/trigger_subaru.cpp @@ -9,12 +9,14 @@ #include "trigger_subaru.h" -static void initialize_one_of_36_2_2_2(TriggerWaveform *s, int firstCount, int secondCount) { +static void initialize_one_of_36_2_2_2(TriggerWaveform *s, int firstCount, int secondCount, bool knownOperationModeHack) { s->initialize(FOUR_STROKE_CRANK_SENSOR, SyncEdge::RiseOnly); #if EFI_UNIT_TEST // placed on 'cam' on '2-stroke' rotary - s->knownOperationMode = false; + if (knownOperationModeHack) { + s->knownOperationMode = false; + } #endif // EFI_UNIT_TEST float wide = 30 * 2; @@ -50,7 +52,7 @@ static void initialize_one_of_36_2_2_2(TriggerWaveform *s, int firstCount, int s * https://rusefi.com/forum/viewtopic.php?f=2&t=1932 */ void initialize36_2_2_2(TriggerWaveform *s) { - initialize_one_of_36_2_2_2(s, 12, 15); + initialize_one_of_36_2_2_2(s, 12, 15, /*knownOperationModeHack*/true); s->setTriggerSynchronizationGap(0.333f); s->setSecondTriggerSynchronizationGap(1.0f); @@ -58,7 +60,7 @@ void initialize36_2_2_2(TriggerWaveform *s) { } void initializeSubaruEZ30(TriggerWaveform *s) { - initialize_one_of_36_2_2_2(s, 18, 9); + initialize_one_of_36_2_2_2(s, 18, 9, /*knownOperationModeHack*/false); s->setTriggerSynchronizationGap3(/*gapIndex*/0, 0.25, 0.5); s->setTriggerSynchronizationGap3(/*gapIndex*/1, 0.7, 1.5);