From 2041298b25249dda2ff4e1250a220d8d2afd9bba Mon Sep 17 00:00:00 2001 From: rusEfi Date: Wed, 29 Oct 2014 20:03:02 -0500 Subject: [PATCH] auto-sync --- firmware/config/engines/dodge_neon.cpp | 3 +++ firmware/controllers/trigger/trigger_chrysler.cpp | 2 +- firmware/controllers/trigger/trigger_decoder.cpp | 4 ++-- firmware/controllers/trigger/trigger_structure.cpp | 2 ++ unit_tests/test_trigger_decoder.cpp | 2 +- 5 files changed, 9 insertions(+), 4 deletions(-) diff --git a/firmware/config/engines/dodge_neon.cpp b/firmware/config/engines/dodge_neon.cpp index 7063e414d9..072d523261 100644 --- a/firmware/config/engines/dodge_neon.cpp +++ b/firmware/config/engines/dodge_neon.cpp @@ -114,6 +114,9 @@ void setDodgeNeonNGCEngineConfiguration(engine_configuration_s *engineConfigurat engineConfiguration->triggerConfig.triggerType = TT_DODGE_NEON_2003; setFrankenso_01_LCD(boardConfiguration); + engineConfiguration->globalTriggerAngleOffset = 46; + engineConfiguration->needSecondTriggerInput = false; + engineConfiguration->cylindersCount = 4; // I want to start with a simple Alpha-N diff --git a/firmware/controllers/trigger/trigger_chrysler.cpp b/firmware/controllers/trigger/trigger_chrysler.cpp index 600290ad7b..87e3488431 100644 --- a/firmware/controllers/trigger/trigger_chrysler.cpp +++ b/firmware/controllers/trigger/trigger_chrysler.cpp @@ -15,7 +15,7 @@ void configureNeon2003TriggerShape(trigger_shape_s *s) { s->gapBothDirections = true; - setTriggerSynchronizationGap(s, 2.5); + setTriggerSynchronizationGap(s, 4); s->addEvent(base + 26, T_PRIMARY, TV_HIGH); s->addEvent(base + 62, T_PRIMARY, TV_LOW); diff --git a/firmware/controllers/trigger/trigger_decoder.cpp b/firmware/controllers/trigger/trigger_decoder.cpp index 2e9cab75a8..fc694a4044 100644 --- a/firmware/controllers/trigger/trigger_decoder.cpp +++ b/firmware/controllers/trigger/trigger_decoder.cpp @@ -117,8 +117,8 @@ void TriggerState::decodeTriggerEvent(trigger_shape_s const*triggerShape, trigge */ nextTriggerEvent(triggerWheel, nowUs); if (triggerShape->gapBothDirections) { -// toothed_previous_duration = getCurrentGapDuration(nowUs); -// toothed_previous_time = nowUs; + toothed_previous_duration = getCurrentGapDuration(nowUs); + toothed_previous_time = nowUs; } return; } diff --git a/firmware/controllers/trigger/trigger_structure.cpp b/firmware/controllers/trigger/trigger_structure.cpp index 4822b7df15..be96f86585 100644 --- a/firmware/controllers/trigger/trigger_structure.cpp +++ b/firmware/controllers/trigger/trigger_structure.cpp @@ -33,6 +33,8 @@ trigger_shape_s::trigger_shape_s() : wave(switchTimesBuffer, NULL) { reset(OM_NONE); wave.waves = h.waves; + useRiseEdge = false; + gapBothDirections = false; } void trigger_shape_s::assignSize() { diff --git a/unit_tests/test_trigger_decoder.cpp b/unit_tests/test_trigger_decoder.cpp index bb36ede35b..a1f2691340 100644 --- a/unit_tests/test_trigger_decoder.cpp +++ b/unit_tests/test_trigger_decoder.cpp @@ -532,7 +532,7 @@ void testTriggerDecoder(void) { testTriggerDecoder2("citroen", CITROEN_TU3JP, 0, 0.4833, 0.0); printGapRatio = true; -// todo testTriggerDecoder2("neon NGC", DODGE_NEON_2003, 6, 0.2139, 0.0); + testTriggerDecoder2("neon NGC", DODGE_NEON_2003, 12, 0.5139, 0.0); testMazda323();