From 25778f089065bc68a9d58462d9631066ec1df4c7 Mon Sep 17 00:00:00 2001 From: rusefi Date: Sun, 21 Aug 2022 12:38:29 -0400 Subject: [PATCH] trigger gap logging: it's a mess :( --- firmware/controllers/trigger/trigger_decoder.cpp | 1 + firmware/controllers/trigger/trigger_state.txt | 2 +- unit_tests/tests/trigger/test_trigger_decoder.cpp | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/firmware/controllers/trigger/trigger_decoder.cpp b/firmware/controllers/trigger/trigger_decoder.cpp index a24d4c2773..9ab870e26e 100644 --- a/firmware/controllers/trigger/trigger_decoder.cpp +++ b/firmware/controllers/trigger/trigger_decoder.cpp @@ -104,6 +104,7 @@ PrimaryTriggerDecoder::PrimaryTriggerDecoder(const char* name) #if ! EFI_PROD_CODE bool printTriggerDebug = false; bool printTriggerTrace = false; +// todo: migrate to triggerSyncGapRatio or triggerActualSyncGapRatio? float actualSynchGap; #endif /* ! EFI_PROD_CODE */ diff --git a/firmware/controllers/trigger/trigger_state.txt b/firmware/controllers/trigger/trigger_state.txt index 1ff4cc52d5..457e6025e3 100644 --- a/firmware/controllers/trigger/trigger_state.txt +++ b/firmware/controllers/trigger/trigger_state.txt @@ -3,7 +3,7 @@ struct_no_prefix trigger_state_s float autoscale vvtSyncGapRatio;;"", 1, 0, -10000, 10000, 3 float autoscale vvtCurrentPosition;;"", 1, 0, -10000, 10000, 3 float autoscale triggerSyncGapRatio;@@GAUGE_NAME_TRG_GAP@@;"", 1, 0, -10000, 10000, 3 - float triggerActualSyncGapRatio; + float triggerActualSyncGapRatio;trigger: unused field? uint8_t triggerStateIndex uint8_t vvtCounter diff --git a/unit_tests/tests/trigger/test_trigger_decoder.cpp b/unit_tests/tests/trigger/test_trigger_decoder.cpp index b562f0de65..52a21a49d7 100644 --- a/unit_tests/tests/trigger/test_trigger_decoder.cpp +++ b/unit_tests/tests/trigger/test_trigger_decoder.cpp @@ -227,6 +227,7 @@ TEST(misc, testFordAspire) { static void testTriggerDecoder2(const char *msg, engine_type_e type, int synchPointIndex, float channel1duty, float channel2duty, float expectedGapRatio = NAN) { printf("====================================================================================== testTriggerDecoder2 msg=%s\r\n", msg); + actualSynchGap = 0; // global variables are bad, let's at least reset state // Some configs use aux valves, which requires this sensor std::unordered_map sensorVals = {{SensorType::DriverThrottleIntent, 0}}; EngineTestHelper eth(type, sensorVals);