diff --git a/firmware/controllers/algo/engine.cpp b/firmware/controllers/algo/engine.cpp index 0dd04c4534..7e5d4a65bb 100644 --- a/firmware/controllers/algo/engine.cpp +++ b/firmware/controllers/algo/engine.cpp @@ -649,3 +649,6 @@ TunerStudioOutputChannels *getTunerStudioOutputChannels() { return &engine->outputChannels; } +ExecutorInterface *getExecutorInterface() { + return &engine->executor; +} diff --git a/firmware/controllers/engine_cycle/main_trigger_callback.cpp b/firmware/controllers/engine_cycle/main_trigger_callback.cpp index 5eb42917a1..99a7c010a5 100644 --- a/firmware/controllers/engine_cycle/main_trigger_callback.cpp +++ b/firmware/controllers/engine_cycle/main_trigger_callback.cpp @@ -382,7 +382,7 @@ void PrimeController::onIgnitionStateChanged(bool ignitionOn) { auto primeDelayMs = engineConfiguration->primingDelay * 1000; auto startTime = getTimeNowNt() + MS2NT(primeDelayMs); - engine->executor.scheduleByTimestampNt("prime", &m_start, startTime, { PrimeController::onPrimeStartAdapter, this}); + getExecutorInterface()->scheduleByTimestampNt("prime", &m_start, startTime, { PrimeController::onPrimeStartAdapter, this}); } else { efiPrintf("Skipped priming pulse since ignSwitchCounter = %d", ignSwitchCounter); } @@ -408,7 +408,7 @@ void PrimeController::onPrimeStart() { // Open all injectors, schedule closing later m_isPriming = true; startSimultaneousInjection(); - engine->executor.scheduleByTimestampNt("prime", &m_end, endTime, { onPrimeEndAdapter, this }); + getExecutorInterface()->scheduleByTimestampNt("prime", &m_end, endTime, { onPrimeEndAdapter, this }); } @@ -417,7 +417,7 @@ void updatePrimeInjectionPulseState() { if (counterWasReset) return; - if (!engine->rpmCalculator.isStopped()) { + if (!getEngineRotationState()->isStopped()) { #if EFI_PROD_CODE backupRamSave(BACKUP_IGNITION_SWITCH_COUNTER, 0); #endif /* EFI_PROD_CODE */ diff --git a/firmware/controllers/system/timer/scheduler.h b/firmware/controllers/system/timer/scheduler.h index 681c328a6a..4c59fd13be 100644 --- a/firmware/controllers/system/timer/scheduler.h +++ b/firmware/controllers/system/timer/scheduler.h @@ -67,3 +67,6 @@ struct ExecutorInterface { virtual void scheduleForLater(const char *msg, scheduling_s *scheduling, int delayUs, action_s action) = 0; virtual void cancel(scheduling_s* scheduling) = 0; }; + +ExecutorInterface *getExecutorInterface(); + diff --git a/firmware/controllers/system/timer/signal_executor_sleep.h b/firmware/controllers/system/timer/signal_executor_sleep.h index 095c71626e..06d43812e2 100644 --- a/firmware/controllers/system/timer/signal_executor_sleep.h +++ b/firmware/controllers/system/timer/signal_executor_sleep.h @@ -16,3 +16,5 @@ public: void scheduleForLater(const char *msg, scheduling_s *scheduling, int delayUs, action_s action) override; void cancel(scheduling_s* s) override; }; + +ExecutorInterface *getExecutorInterface();