diff --git a/firmware/config/engines/honda_accord.cpp b/firmware/config/engines/honda_accord.cpp index 23b2b8c6cf..a8e7eae087 100644 --- a/firmware/config/engines/honda_accord.cpp +++ b/firmware/config/engines/honda_accord.cpp @@ -207,7 +207,6 @@ void setHondaAccordConfiguration1_24_shifted(DECLARE_ENGINE_PARAMETER_F) { } - void setHondaCivic4_0_both(DECLARE_ENGINE_PARAMETER_F) { setHondaAccordConfiguration1_24_shifted(PASS_ENGINE_PARAMETER_F); @@ -217,3 +216,13 @@ void setHondaCivic4_0_both(DECLARE_ENGINE_PARAMETER_F) { engineConfiguration->trigger.type = TT_TOOTHED_WHEEL; } + +void setHondaCivic4_0_rise(DECLARE_ENGINE_PARAMETER_F) { + setHondaAccordConfiguration1_24_shifted(PASS_ENGINE_PARAMETER_F); + + engineConfiguration->useOnlyRisingEdgeForTrigger = true; + engineConfiguration->trigger.customTotalToothCount = 4; + engineConfiguration->trigger.customSkippedToothCount = 0; + + engineConfiguration->trigger.type = TT_TOOTHED_WHEEL; +} diff --git a/firmware/controllers/algo/engine_configuration.cpp b/firmware/controllers/algo/engine_configuration.cpp index 7749259977..73d3fb3fc5 100644 --- a/firmware/controllers/algo/engine_configuration.cpp +++ b/firmware/controllers/algo/engine_configuration.cpp @@ -914,8 +914,12 @@ void resetConfigurationExt(Logging * logger, engine_type_e engineType DECLARE_EN case MIATA_NA_1_6: setMiataNA_1_6_Configuration(PASS_ENGINE_PARAMETER_F); break; - case TEST_CIVIC_4_0_RISE: case TEST_CIVIC_4_0_BOTH: + setHondaCivic4_0_both(PASS_ENGINE_PARAMETER_F); + break; + case TEST_CIVIC_4_0_RISE: + setHondaCivic4_0_rise(PASS_ENGINE_PARAMETER_F); + break; case HONDA_ACCORD_CD_TWO_WIRES: setHondaAccordConfiguration1_24(PASS_ENGINE_PARAMETER_F); break; diff --git a/unit_tests/test_trigger_decoder.cpp b/unit_tests/test_trigger_decoder.cpp index 09b3529f07..e8d517a6f6 100644 --- a/unit_tests/test_trigger_decoder.cpp +++ b/unit_tests/test_trigger_decoder.cpp @@ -489,6 +489,9 @@ void testTriggerDecoder(void) { test1995FordInline6TriggerDecoder(); testTriggerDecoder2("Miata NB", MAZDA_MIATA_NB1, 12, 0.0833, 0.0444); + 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.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);