From 1c154f6ee7bae858617fd3a611cf318dbc072bd8 Mon Sep 17 00:00:00 2001 From: rusefillc Date: Sun, 10 Sep 2023 10:34:06 -0400 Subject: [PATCH] 2JZ cam trigger configuration is much easier to adjust #5557 only:proteus_f4 --- firmware/CHANGELOG.md | 1 + firmware/controllers/algo/defaults/default_base_engine.cpp | 2 +- firmware/controllers/trigger/trigger_central.cpp | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/firmware/CHANGELOG.md b/firmware/CHANGELOG.md index d24af02c05..e3205a42f7 100644 --- a/firmware/CHANGELOG.md +++ b/firmware/CHANGELOG.md @@ -45,6 +45,7 @@ Release template (copy/paste this for new release): - simulator: sensor mocking UI #5473 - Custom Trigger Tooth with 1+0 causes endless loop #5471 - nucleo-h7 bundle st-link flushing #5486 + - 2JZ cam trigger configuration is much easier to adjust #5557 ## July 2023 Release "Day 518" diff --git a/firmware/controllers/algo/defaults/default_base_engine.cpp b/firmware/controllers/algo/defaults/default_base_engine.cpp index f014987e79..2a27bca1bf 100644 --- a/firmware/controllers/algo/defaults/default_base_engine.cpp +++ b/firmware/controllers/algo/defaults/default_base_engine.cpp @@ -75,7 +75,7 @@ void setDefaultBaseEngine() { engineConfiguration->primingDelay = 0.5; engineConfiguration->vvtControlMinRpm = 500.0; - engineConfiguration->camDecoder2jzPosition = 75; + engineConfiguration->camDecoder2jzPosition = 95; engineConfiguration->camDecoder2jzPrecision = 25; // Limits and Fallbacks diff --git a/firmware/controllers/trigger/trigger_central.cpp b/firmware/controllers/trigger/trigger_central.cpp index 175f17f9dc..0657068ee1 100644 --- a/firmware/controllers/trigger/trigger_central.cpp +++ b/firmware/controllers/trigger/trigger_central.cpp @@ -354,8 +354,8 @@ void hwHandleVvtCamSignal(TriggerValue front, efitick_t nowNt, int index) { int from = engineConfiguration->camDecoder2jzPosition - engineConfiguration->camDecoder2jzPrecision; int to = engineConfiguration->camDecoder2jzPosition + engineConfiguration->camDecoder2jzPrecision; // we do not know if we are in sync or out of sync, so we have to be looking for both possibilities - if ((currentPosition < from || to) && - (currentPosition < from + 360 || to + 360)) { + if ((currentPosition < from || currentPosition > to) && + (currentPosition < from + 360 || currentPosition > to + 360)) { // outside of the expected range return; }