diff --git a/firmware/controllers/trigger/trigger_decoder.cpp b/firmware/controllers/trigger/trigger_decoder.cpp index 46ca80ffc4..0c00403d36 100644 --- a/firmware/controllers/trigger/trigger_decoder.cpp +++ b/firmware/controllers/trigger/trigger_decoder.cpp @@ -110,8 +110,6 @@ 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 */ void TriggerWaveform::initializeSyncPoint(TriggerDecoderBase& state, @@ -461,10 +459,6 @@ expected TriggerDecoderBase::decodeTriggerEvent( */ bool silentTriggerError = triggerShape.getSize() > 40 && engineConfiguration->silentTriggerError; -#if EFI_UNIT_TEST - actualSynchGap = triggerSyncGapRatio; -#endif /* EFI_UNIT_TEST */ - #if EFI_PROD_CODE || EFI_SIMULATOR bool verbose = getTriggerCentral()->isEngineSnifferEnabled && triggerConfiguration.VerboseTriggerSynchDetails; diff --git a/firmware/controllers/trigger/trigger_state.txt b/firmware/controllers/trigger/trigger_state.txt index 72189f3681..771840689b 100644 --- a/firmware/controllers/trigger/trigger_state.txt +++ b/firmware/controllers/trigger/trigger_state.txt @@ -3,7 +3,6 @@ struct_no_prefix trigger_state_s float vvtSyncGapRatio;;"", 1, 0, -10000, 10000, 3 float vvtCurrentPosition;;"", 1, 0, -10000, 10000, 3 float triggerSyncGapRatio;@@GAUGE_NAME_TRG_GAP@@;"", 1, 0, -10000, 10000, 3 - 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 faecb9e360..39725c6cff 100644 --- a/unit_tests/tests/trigger/test_trigger_decoder.cpp +++ b/unit_tests/tests/trigger/test_trigger_decoder.cpp @@ -24,7 +24,6 @@ using ::testing::_; extern WarningCodeState unitTestWarningCodeState; extern bool printTriggerDebug; -extern float actualSynchGap; extern "C" { void sendOutConfirmation(char *value, int i); @@ -159,7 +158,6 @@ 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); @@ -170,7 +168,7 @@ static void testTriggerDecoder2(const char *msg, engine_type_e type, int synchPo assertEqualsM("synchPointIndex", synchPointIndex, t->getTriggerWaveformSynchPointIndex()); if (!cisnan(expectedGapRatio)) { - assertEqualsM2("actual gap ratio", expectedGapRatio, actualSynchGap, 0.001); + assertEqualsM2("actual gap ratio", expectedGapRatio, engine->triggerCentral.triggerState.triggerSyncGapRatio, 0.001); } }