From 45d88f1d2636b17e7a3291d13f3ffccd3895ddbf Mon Sep 17 00:00:00 2001 From: rusefillc Date: Thu, 15 Sep 2022 22:21:07 -0400 Subject: [PATCH] tear down Engine god object #4511 --- firmware/controllers/engine_cycle/main_trigger_callback.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/firmware/controllers/engine_cycle/main_trigger_callback.cpp b/firmware/controllers/engine_cycle/main_trigger_callback.cpp index 1550b71782..8dcf9589e8 100644 --- a/firmware/controllers/engine_cycle/main_trigger_callback.cpp +++ b/firmware/controllers/engine_cycle/main_trigger_callback.cpp @@ -199,12 +199,12 @@ void InjectionEvent::onTriggerTooth(int rpm, efitick_t nowNt, float currentPhase float angleFromNow = eventAngle - currentPhase; if (angleFromNow < 0) { - angleFromNow += engine->engineState.engineCycle; + angleFromNow += getEngineState()->engineCycle; } efitick_t startTime = scheduleByAngle(&signalTimerUp, nowNt, angleFromNow, startAction); efitick_t turnOffTime = startTime + US2NT((int)durationUs); - engine->executor.scheduleByTimestampNt("inj", &endOfInjectionEvent, turnOffTime, endAction); + getExecutorInterface()->scheduleByTimestampNt("inj", &endOfInjectionEvent, turnOffTime, endAction); #if EFI_UNIT_TEST printf("scheduling injection angle=%.2f/delay=%.2f injectionDuration=%.2f\r\n", angleFromNow, NT2US(startTime - nowNt), injectionDuration); @@ -288,7 +288,7 @@ void mainTriggerCallback(uint32_t trgEventIndex, efitick_t edgeTimestamp, angle_ if (trgEventIndex == 0) { - if (engine->triggerCentral.checkIfTriggerConfigChanged()) { + if (getTriggerCentral()->checkIfTriggerConfigChanged()) { engine->ignitionEvents.isReady = false; // we need to rebuild complete ignition schedule engine->injectionEvents.isReady = false; // moved 'triggerIndexByAngle' into trigger initialization (why was it invoked from here if it's only about trigger shape & optimization?)