From dae0b1d7909fc458847253f2197ee7fbc6d0eb4f Mon Sep 17 00:00:00 2001 From: rusefi Date: Mon, 6 Mar 2017 17:42:16 -0500 Subject: [PATCH] fixed #366 --- README.md | 1 + firmware/config/engines/test_engine.cpp | 19 +++++++++++++++++-- firmware/config/engines/test_engine.h | 3 ++- .../controllers/algo/auto_generated_enums.cpp | 3 ++- .../controllers/algo/engine_configuration.cpp | 10 +++++++--- firmware/controllers/algo/rusefi_enums.h | 3 ++- .../trigger/decoders/trigger_universal.cpp | 2 +- firmware/rusefi.cpp | 2 +- unit_tests/test_trigger_decoder.cpp | 3 +++ 9 files changed, 36 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index a58e8f1e32..cf6b92015d 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ current binaries are always available at http://rusefi.com/build_server/ | Release date | Revision | Details | | ------------ | --------- | ------- | +| 03/06/2017 | r13123 | bugfix #363: 2/1 skipped wheel is a corner-case | | 03/05/2017 | r13108 | bugfix #363: trigger front only processing | | 02/22/2017 | r12980 | bugfix: false error message in case of single coin or simultaneous injection | | 02/22/2017 | r12973 | unused property 'custom Use Rise Edge' removed | diff --git a/firmware/config/engines/test_engine.cpp b/firmware/config/engines/test_engine.cpp index 54c4f53b90..9b18b246eb 100644 --- a/firmware/config/engines/test_engine.cpp +++ b/firmware/config/engines/test_engine.cpp @@ -72,7 +72,22 @@ void setTestVVTEngineConfiguration(DECLARE_ENGINE_PARAMETER_F) { } #if EFI_UNIT_TEST || defined(__DOXYGEN__) -void setTestEngineIssue366(DECLARE_ENGINE_PARAMETER_F) { +void setTestEngineIssue366both(DECLARE_ENGINE_PARAMETER_F) { + setTestEngineConfiguration(PASS_ENGINE_PARAMETER_F); + + + engineConfiguration->useOnlyRisingEdgeForTrigger = false; + engineConfiguration->trigger.customTotalToothCount = 2; + engineConfiguration->trigger.customSkippedToothCount = 1; + + engineConfiguration->trigger.type = TT_TOOTHED_WHEEL; } -#endif + +void setTestEngineIssue366rise(DECLARE_ENGINE_PARAMETER_F) { + setTestEngineIssue366both(PASS_ENGINE_PARAMETER_F); + + + engineConfiguration->useOnlyRisingEdgeForTrigger = true; +} +#endif /* EFI_UNIT_TEST */ diff --git a/firmware/config/engines/test_engine.h b/firmware/config/engines/test_engine.h index a4d36cb711..46799de4db 100644 --- a/firmware/config/engines/test_engine.h +++ b/firmware/config/engines/test_engine.h @@ -12,6 +12,7 @@ void setTestEngineConfiguration(DECLARE_ENGINE_PARAMETER_F); void setTestVVTEngineConfiguration(DECLARE_ENGINE_PARAMETER_F); -void setTestEngineIssue366(DECLARE_ENGINE_PARAMETER_F); +void setTestEngineIssue366both(DECLARE_ENGINE_PARAMETER_F); +void setTestEngineIssue366rise(DECLARE_ENGINE_PARAMETER_F); #endif /* TEST_ENGINE_H_ */ diff --git a/firmware/controllers/algo/auto_generated_enums.cpp b/firmware/controllers/algo/auto_generated_enums.cpp index a034b72ab7..fb29c6df04 100644 --- a/firmware/controllers/algo/auto_generated_enums.cpp +++ b/firmware/controllers/algo/auto_generated_enums.cpp @@ -127,7 +127,8 @@ case DODGE_STRATUS: case TEST_CIVIC_4_0_BOTH: case TEST_CIVIC_4_0_RISE: return "civictest"; -case TEST_ISSUE_366: +case TEST_ISSUE_366_BOTH: +case TEST_ISSUE_366_RISE: return "unittest"; } return NULL; diff --git a/firmware/controllers/algo/engine_configuration.cpp b/firmware/controllers/algo/engine_configuration.cpp index c66d8ef9bb..50807761eb 100644 --- a/firmware/controllers/algo/engine_configuration.cpp +++ b/firmware/controllers/algo/engine_configuration.cpp @@ -1004,11 +1004,15 @@ void resetConfigurationExt(Logging * logger, engine_type_e engineType DECLARE_EN setVwAba(PASS_ENGINE_PARAMETER_F); break; #if EFI_UNIT_TEST - case TEST_ISSUE_366: - setTestEngineIssue366(PASS_ENGINE_PARAMETER_F); + case TEST_ISSUE_366_BOTH: + setTestEngineIssue366both(PASS_ENGINE_PARAMETER_F); + break; + case TEST_ISSUE_366_RISE: + setTestEngineIssue366rise(PASS_ENGINE_PARAMETER_F); break; #else - case TEST_ISSUE_366: + case TEST_ISSUE_366_BOTH: + case TEST_ISSUE_366_RISE: #endif case TEST_ENGINE: diff --git a/firmware/controllers/algo/rusefi_enums.h b/firmware/controllers/algo/rusefi_enums.h index cd27b8d21b..4223221cae 100644 --- a/firmware/controllers/algo/rusefi_enums.h +++ b/firmware/controllers/algo/rusefi_enums.h @@ -154,7 +154,8 @@ typedef enum { //todo: why does this not work?#if EFI_UNIT_TEST || defined(__DOXYGEN__) - TEST_ISSUE_366 = 52, + TEST_ISSUE_366_BOTH = 52, + TEST_ISSUE_366_RISE = 53, //todo:#endif Force_4b_engine_type = ENUM_32_BITS, diff --git a/firmware/controllers/trigger/decoders/trigger_universal.cpp b/firmware/controllers/trigger/decoders/trigger_universal.cpp index 667277b476..f26e9af756 100644 --- a/firmware/controllers/trigger/decoders/trigger_universal.cpp +++ b/firmware/controllers/trigger/decoders/trigger_universal.cpp @@ -40,7 +40,7 @@ void initializeSkippedToothTriggerShapeExt(TriggerShape *s, int totalTeethCount, s->initialize(operationMode, false); s->setTriggerSynchronizationGap(skippedCount + 1); - s->isSynchronizationNeeded = (skippedCount != 0); + s->isSynchronizationNeeded = (totalTeethCount > 2) && (skippedCount != 0); addSkippedToothTriggerEvents(T_PRIMARY, s, totalTeethCount, skippedCount, 0.5, 0, getEngineCycle(operationMode), NO_LEFT_FILTER, NO_RIGHT_FILTER PASS_ENGINE_PARAMETER); diff --git a/firmware/rusefi.cpp b/firmware/rusefi.cpp index c8ce9d3a6e..923253c431 100644 --- a/firmware/rusefi.cpp +++ b/firmware/rusefi.cpp @@ -249,5 +249,5 @@ int getRusEfiVersion(void) { return 123; // this is here to make the compiler happy about the unused array if (UNUSED_CCM_SIZE[0] * 0 != 0) return 3211; // this is here to make the compiler happy about the unused array - return 20170305; + return 20170306; } diff --git a/unit_tests/test_trigger_decoder.cpp b/unit_tests/test_trigger_decoder.cpp index 8330d2f783..a511fedc30 100644 --- a/unit_tests/test_trigger_decoder.cpp +++ b/unit_tests/test_trigger_decoder.cpp @@ -494,6 +494,9 @@ void testTriggerDecoder(void) { testTriggerDecoder2("Civic 4/0 both", TEST_CIVIC_4_0_BOTH, 0, 0.5000, 0.0); testTriggerDecoder2("Civic 4/0 rise", TEST_CIVIC_4_0_RISE, 0, 0.5000, 0.0); + testTriggerDecoder2("test 2/1 both", TEST_ISSUE_366_BOTH, 0, 0.2500, 0.0); + testTriggerDecoder2("test 2/1 rise", TEST_ISSUE_366_RISE, 0, 0.0000, 0.0); + testTriggerDecoder2("test engine", TEST_ENGINE, 0, 0.7500, 0.2500); testTriggerDecoder2("testGY6_139QMB", GY6_139QMB, 0, 0.4375, 0.0); testTriggerDecoder2("testSubary", SUBARU_2003_WRX, 0, 0.4000, 0.0);