diff --git a/firmware/controllers/engine_controller.cpp b/firmware/controllers/engine_controller.cpp index 8be54b0846..89a6126d9f 100644 --- a/firmware/controllers/engine_controller.cpp +++ b/firmware/controllers/engine_controller.cpp @@ -626,7 +626,7 @@ void initEngineContoller(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX) /** * This method initialized the main listener which actually runs injectors & ignition */ - initMainEventListener(sharedLogger, engine); + initMainEventListener(sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX); } #endif /* EFI_ENGINE_CONTROL */ diff --git a/firmware/controllers/trigger/main_trigger_callback.cpp b/firmware/controllers/trigger/main_trigger_callback.cpp index 9ab442895a..0ab7de8a7e 100644 --- a/firmware/controllers/trigger/main_trigger_callback.cpp +++ b/firmware/controllers/trigger/main_trigger_callback.cpp @@ -357,7 +357,7 @@ static ALWAYS_INLINE void handleFuel(const bool limitedFuel, uint32_t trgEventIn efiAssertVoid(getRemainingStack(chThdGetSelfX()) > 128, "lowstck#3"); efiAssertVoid(trgEventIndex < engine->engineCycleEventCount, "handleFuel/event index"); - if (!isInjectionEnabled(engineConfiguration) || limitedFuel) { + if (!isInjectionEnabled(PASS_ENGINE_PARAMETER_SIGNATURE) || limitedFuel) { return; } if (engine->isCylinderCleanupMode) { @@ -535,7 +535,7 @@ static void showMainInfo(Engine *engine) { #endif } -void initMainEventListener(Logging *sharedLogger, Engine *engine) { +void initMainEventListener(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX) { logger = sharedLogger; efiAssertVoid(engine!=NULL, "null engine"); initSparkLogic(logger); @@ -545,7 +545,7 @@ void initMainEventListener(Logging *sharedLogger, Engine *engine) { addConsoleActionP("maininfo", (VoidPtr) showMainInfo, engine); printMsg(logger, "initMainLoop: %d", currentTimeMillis()); - if (!isInjectionEnabled(engine->engineConfiguration)) + if (!isInjectionEnabled(PASS_ENGINE_PARAMETER_SIGNATURE)) printMsg(logger, "!!!!!!!!!!!!!!!!!!! injection disabled"); #endif diff --git a/firmware/controllers/trigger/main_trigger_callback.h b/firmware/controllers/trigger/main_trigger_callback.h index e2f93008b9..9b43d97320 100644 --- a/firmware/controllers/trigger/main_trigger_callback.h +++ b/firmware/controllers/trigger/main_trigger_callback.h @@ -15,7 +15,7 @@ #include "event_registry.h" #include "engine.h" -void initMainEventListener(Logging *sharedLogger, Engine *engine); +void initMainEventListener(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX); void mainTriggerCallback(trigger_event_e ckpSignalType, uint32_t eventIndex DECLARE_ENGINE_PARAMETER_SUFFIX); int isIgnitionTimingError(void); diff --git a/firmware/controllers/trigger/spark_logic.cpp b/firmware/controllers/trigger/spark_logic.cpp index bd25dc142e..b11da72c5d 100644 --- a/firmware/controllers/trigger/spark_logic.cpp +++ b/firmware/controllers/trigger/spark_logic.cpp @@ -21,9 +21,9 @@ IgnitionEventList::IgnitionEventList() { isReady = false; } -int isInjectionEnabled(engine_configuration_s *engineConfiguration) { +int isInjectionEnabled(DECLARE_ENGINE_PARAMETER_SIGNATURE) { // todo: is this worth a method? should this be inlined? - return engineConfiguration->isInjectionEnabled; + return CONFIG(isInjectionEnabled); } int isIgnitionTimingError(void) { diff --git a/firmware/controllers/trigger/spark_logic.h b/firmware/controllers/trigger/spark_logic.h index 1e091c68d7..98fbf1a6dc 100644 --- a/firmware/controllers/trigger/spark_logic.h +++ b/firmware/controllers/trigger/spark_logic.h @@ -10,7 +10,7 @@ #include "engine.h" -int isInjectionEnabled(engine_configuration_s *engineConfiguration); +int isInjectionEnabled(DECLARE_ENGINE_PARAMETER_SIGNATURE); void handleSpark(bool limitedSpark, uint32_t trgEventIndex, int rpm DECLARE_ENGINE_PARAMETER_SUFFIX); void initSparkLogic(Logging *sharedLogger); void turnSparkPinHigh(IgnitionEvent *event);