From 28d797d5c2a97cdca6af7d67287f96ecd51c102f Mon Sep 17 00:00:00 2001 From: Andrey Date: Wed, 31 Aug 2022 23:49:38 -0400 Subject: [PATCH] moving confusion further away from fuel control --- .../controllers/engine_cycle/main_trigger_callback.cpp | 7 ------- firmware/controllers/trigger/trigger_central.cpp | 8 ++++++++ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/firmware/controllers/engine_cycle/main_trigger_callback.cpp b/firmware/controllers/engine_cycle/main_trigger_callback.cpp index ef5e85162e..9838c9e128 100644 --- a/firmware/controllers/engine_cycle/main_trigger_callback.cpp +++ b/firmware/controllers/engine_cycle/main_trigger_callback.cpp @@ -383,13 +383,6 @@ void mainTriggerCallback(uint32_t trgEventIndex, efitick_t edgeTimestamp, angle_ } #endif // HW_CHECK_MODE -#if EFI_CDM_INTEGRATION - if (trgEventIndex == 0 && isBrainPinValid(engineConfiguration->cdmInputPin)) { - int cdmKnockValue = getCurrentCdmValue(engine->triggerCentral.triggerState.getTotalRevolutionCounter()); - engine->knockLogic(cdmKnockValue); - } -#endif /* EFI_CDM_INTEGRATION */ - int rpm = engine->rpmCalculator.getCachedRpm(); if (rpm == 0) { // this happens while we just start cranking diff --git a/firmware/controllers/trigger/trigger_central.cpp b/firmware/controllers/trigger/trigger_central.cpp index 0b08f953b5..e051090ce4 100644 --- a/firmware/controllers/trigger/trigger_central.cpp +++ b/firmware/controllers/trigger/trigger_central.cpp @@ -750,6 +750,14 @@ void TriggerCentral::handleShaftSignal(trigger_event_e signal, efitick_t timesta wrapAngle(nextPhase, "nextEnginePhase", CUSTOM_ERR_6555); } while (nextPhase == currentPhase); + +#if EFI_CDM_INTEGRATION + if (trgEventIndex == 0 && isBrainPinValid(engineConfiguration->cdmInputPin)) { + int cdmKnockValue = getCurrentCdmValue(engine->triggerCentral.triggerState.getTotalRevolutionCounter()); + engine->knockLogic(cdmKnockValue); + } +#endif /* EFI_CDM_INTEGRATION */ + // Handle ignition and injection mainTriggerCallback(triggerIndexForListeners, timestamp, currentPhase, nextPhase);