a bit of dead code

This commit is contained in:
Andrey 2023-01-03 07:49:17 -05:00
parent f13391325c
commit 603f188b55
3 changed files with 1 additions and 10 deletions

View File

@ -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<TriggerDecodeResult> 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;

View File

@ -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

View File

@ -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<SensorType, float> 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);
}
}