From 6d752566a4e38460852dfb971e298368a9d50b46 Mon Sep 17 00:00:00 2001 From: rusEfi Date: Tue, 14 Apr 2015 00:10:08 -0400 Subject: [PATCH] auto-sync --- firmware/config/engines/bmw_e34.cpp | 3 ++- firmware/controllers/trigger/trigger_decoder.cpp | 2 +- unit_tests/test_trigger_decoder.cpp | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/firmware/config/engines/bmw_e34.cpp b/firmware/config/engines/bmw_e34.cpp index 6cfc9362bc..8d800a78ac 100644 --- a/firmware/config/engines/bmw_e34.cpp +++ b/firmware/config/engines/bmw_e34.cpp @@ -38,6 +38,7 @@ void setBmwE34(DECLARE_ENGINE_PARAMETER_F) { engineConfiguration->injectionMode = IM_BATCH; engineConfiguration->twoWireBatch = true; engineConfiguration->ignitionMode = IM_WASTED_SPARK; + engineConfiguration->useOnlyFrontForTrigger = true; // Trigger configuration engineConfiguration->trigger.type = TT_TOOTHED_WHEEL_60_2; @@ -59,7 +60,7 @@ void setBmwE34(DECLARE_ENGINE_PARAMETER_F) { engineConfiguration->isIgnitionEnabled = true; setConstantDwell(3 PASS_ENGINE_PARAMETER); // a bit shorter dwell - engineConfiguration->ignMathCalculateAtIndex = 15; + engineConfiguration->ignMathCalculateAtIndex = 14; // Cranking engineConfiguration->cranking.rpm = 600; diff --git a/firmware/controllers/trigger/trigger_decoder.cpp b/firmware/controllers/trigger/trigger_decoder.cpp index 9bd5f9ce12..5fccf7c77e 100644 --- a/firmware/controllers/trigger/trigger_decoder.cpp +++ b/firmware/controllers/trigger/trigger_decoder.cpp @@ -113,7 +113,7 @@ void TriggerState::decodeTriggerEvent(trigger_event_e const signal, uint64_t now trigger_wheel_e triggerWheel = eventIndex[signal]; - if (curSignal == prevSignal) { + if (!engineConfiguration->useOnlyFrontForTrigger && curSignal == prevSignal) { orderingErrorCounter++; } diff --git a/unit_tests/test_trigger_decoder.cpp b/unit_tests/test_trigger_decoder.cpp index 818e718430..5a6fb9cbe8 100644 --- a/unit_tests/test_trigger_decoder.cpp +++ b/unit_tests/test_trigger_decoder.cpp @@ -511,7 +511,7 @@ void testTriggerDecoder(void) { testTriggerDecoder2("ford aspire", FORD_ASPIRE_1996, 4, 0.0, 0.5); //testTriggerDecoder2("bmw", BMW_E34, 0, 0.9750, 0.5167); - testTriggerDecoder2("bmw", BMW_E34, 0, 0.4833, 0.0); + testTriggerDecoder2("bmw", BMW_E34, 0, 0.5167, 0.0); test1995FordInline6TriggerDecoder(); testMazdaMianaNbDecoder();