From af25eb8c6df04fa8eff3ca7b49c2891580ff2ebd Mon Sep 17 00:00:00 2001 From: rusefi Date: Sun, 28 Oct 2018 17:20:43 -0400 Subject: [PATCH] making validation stronger --- firmware/controllers/trigger/trigger_simulator.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/firmware/controllers/trigger/trigger_simulator.cpp b/firmware/controllers/trigger/trigger_simulator.cpp index 18d7a75c07..cbe608f9f5 100644 --- a/firmware/controllers/trigger/trigger_simulator.cpp +++ b/firmware/controllers/trigger/trigger_simulator.cpp @@ -87,11 +87,11 @@ void TriggerStimulatorHelper::assertSyncPositionAndSetDutyCycle(const uint32_t s /** * let's feed two more cycles to validate shape definition */ - for (uint32_t i = syncIndex + 1; i <= syncIndex + 2 * shape->getSize(); i++) { + for (uint32_t i = syncIndex + 1; i <= syncIndex + GAP_TRACKING_LENGTH * shape->getSize(); i++) { feedSimulatedEvent(state, shape, i PASS_ENGINE_PARAMETER_SUFFIX); } int revolutionCounter = state->getTotalRevolutionCounter(); - if (revolutionCounter != 3) { + if (revolutionCounter != GAP_TRACKING_LENGTH + 1) { warning(CUSTOM_OBD_TRIGGER_SHAPE, "sync failed/wrong gap parameters trigger=%s rc=%d", getTrigger_type_e(engineConfiguration->trigger.type), revolutionCounter); shape->shapeDefinitionError = true; return;