Skip to content

Commit

Permalink
fix Subaru EZ30 trigger gaps fix #4344
Browse files Browse the repository at this point in the history
  • Loading branch information
rusefillc committed Jul 31, 2022
1 parent e348ef8 commit 122db2d
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions firmware/controllers/trigger/decoders/trigger_subaru.cpp
Expand Up @@ -20,10 +20,6 @@ static void initialize_one_of_36_2_2_2(TriggerWaveform *s, int firstCount, int s
float wide = 30 * 2;
float narrow = 10 * 2;

s->setTriggerSynchronizationGap(0.333f);
s->setSecondTriggerSynchronizationGap(1.0f);
s->setThirdTriggerSynchronizationGap(3.0f);

float base = 0;

for (int i = 0; i < firstCount; i++) {
Expand Down Expand Up @@ -56,10 +52,18 @@ static void initialize_one_of_36_2_2_2(TriggerWaveform *s, int firstCount, int s
*/
void initialize36_2_2_2(TriggerWaveform *s) {
initialize_one_of_36_2_2_2(s, 12, 15, true);

s->setTriggerSynchronizationGap(0.333f);
s->setSecondTriggerSynchronizationGap(1.0f);
s->setThirdTriggerSynchronizationGap(3.0f);
}

void initializeSubaruEZ30(TriggerWaveform *s) {
initialize_one_of_36_2_2_2(s, 18, 9, true);

s->setTriggerSynchronizationGap3(/*gapIndex*/0, 0.25, 0.5);
s->setTriggerSynchronizationGap3(/*gapIndex*/1, 0.7, 1.5);
s->setTriggerSynchronizationGap3(/*gapIndex*/2, 2, 4);
}

static void initializeSubaru7_6(TriggerWaveform *s, bool withCrankWheel) {
Expand Down

0 comments on commit 122db2d

Please sign in to comment.