From 91e1eb825f5ae5c9c2cde2b49837862a88b2899d Mon Sep 17 00:00:00 2001 From: Andrey Date: Tue, 28 Mar 2023 21:42:20 -0400 Subject: [PATCH] K only:hellen-honda-k --- firmware/config/engines/honda_k_dbc.cpp | 5 +++-- unit_tests/tests/trigger/test_real_k20.cpp | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/firmware/config/engines/honda_k_dbc.cpp b/firmware/config/engines/honda_k_dbc.cpp index 6731fe8583..cd29d1658a 100644 --- a/firmware/config/engines/honda_k_dbc.cpp +++ b/firmware/config/engines/honda_k_dbc.cpp @@ -17,14 +17,15 @@ void setHondaK() { engineConfiguration->specs.firingOrder = FO_1_3_4_2; engineConfiguration->engineSyncCam = SC_Exhaust_First; engineConfiguration->trigger.type = TT_HONDA_K_CRANK_12_1; - engineConfiguration->globalTriggerAngleOffset = 663; + int magic = 12; // note that offset and VVT are related + engineConfiguration->globalTriggerAngleOffset = 675 - magic; // VVT is here just single tooth? and we do not even use it!? engineConfiguration->vvtMode[0] = VVT_HONDA_K_INTAKE; // also known as 'CAM sync'? i am pretty confused at this point engineConfiguration->vvtMode[1] = VVT_HONDA_K_EXHAUST; engineConfiguration->vvtOffsets[0] = -41; - engineConfiguration->vvtOffsets[1] = 171; + engineConfiguration->vvtOffsets[1] = 171 + magic; // set cranking_fuel 15 engineConfiguration->cranking.baseFuel = 75; diff --git a/unit_tests/tests/trigger/test_real_k20.cpp b/unit_tests/tests/trigger/test_real_k20.cpp index f6525f791a..82146b420b 100644 --- a/unit_tests/tests/trigger/test_real_k20.cpp +++ b/unit_tests/tests/trigger/test_real_k20.cpp @@ -25,7 +25,7 @@ TEST(realk20, cranking) { float vvtE = engine->triggerCentral.getVVTPosition(/*bankIndex*/0, /*camIndex*/1); if (vvtE != 0) { - EXPECT_TRUE(vvtE > -10 && vvtE < 10); + EXPECT_TRUE(vvtE > -10 && vvtE < 10) << vvtE; } }