diff --git a/firmware/controllers/injector_central.cpp b/firmware/controllers/injector_central.cpp index ea8c294dba..7cf62ca662 100644 --- a/firmware/controllers/injector_central.cpp +++ b/firmware/controllers/injector_central.cpp @@ -232,7 +232,7 @@ void OutputPin::unregisterOutput(brain_pin_e oldPin, brain_pin_e newPin) { } } -void stopIgnitionPins(void) { +void EnginePins::stopIgnitionPins(void) { for (int i = 0; i < IGNITION_PIN_COUNT; i++) { NamedOutputPin *output = &enginePins.coils[i]; output->unregisterOutput(activeConfiguration.bc.ignitionPins[i], @@ -240,7 +240,7 @@ void stopIgnitionPins(void) { } } -void stopInjectionPins(void) { +void EnginePins::stopInjectionPins(void) { for (int i = 0; i < INJECTION_PIN_COUNT; i++) { NamedOutputPin *output = &enginePins.injectors[i]; output->unregisterOutput(activeConfiguration.bc.injectionPins[i], @@ -248,7 +248,7 @@ void stopInjectionPins(void) { } } -void startIgnitionPins(void) { +void EnginePins::startIgnitionPins(void) { for (int i = 0; i < engineConfiguration->specs.cylindersCount; i++) { NamedOutputPin *output = &enginePins.coils[i]; // todo: we need to check if mode has changed @@ -265,7 +265,7 @@ void startIgnitionPins(void) { } } -void startInjectionPins(void) { +void EnginePins::startInjectionPins(void) { // todo: should we move this code closer to the injection logic? for (int i = 0; i < engineConfiguration->specs.cylindersCount; i++) { NamedOutputPin *output = &enginePins.injectors[i]; @@ -304,8 +304,8 @@ void initInjectorCentral(Logging *sharedLogger) { is_injector_enabled[i] = true; } - startInjectionPins(); - startIgnitionPins(); + enginePins.startInjectionPins(); + enginePins.startIgnitionPins(); printInjectorsStatus(); addConsoleActionII("injector", setInjectorEnabled); diff --git a/firmware/controllers/injector_central.h b/firmware/controllers/injector_central.h index a280469e8a..06663ce228 100644 --- a/firmware/controllers/injector_central.h +++ b/firmware/controllers/injector_central.h @@ -20,11 +20,6 @@ void milBench(void); void initInjectorCentral(Logging *sharedLogger); bool isRunningBenchTest(void); -void stopInjectionPins(void); -void startInjectionPins(void); - -void stopIgnitionPins(void); -void startIgnitionPins(void); void runIoTest(int subsystem, int index); #endif /* INJECTOR_CENTRAL_H_ */ diff --git a/firmware/controllers/system/efiGpio.h b/firmware/controllers/system/efiGpio.h index 867d078e13..bbed4a3227 100644 --- a/firmware/controllers/system/efiGpio.h +++ b/firmware/controllers/system/efiGpio.h @@ -91,6 +91,10 @@ public: void reset(); bool stopPins(); void unregisterPins(); + void startInjectionPins(); + void startIgnitionPins(); + void stopInjectionPins(); + void stopIgnitionPins(); OutputPin mainRelay; OutputPin fanRelay; OutputPin acRelay; diff --git a/firmware/hw_layer/hardware.cpp b/firmware/hw_layer/hardware.cpp index cff6ae5ce9..1a9ad26451 100644 --- a/firmware/hw_layer/hardware.cpp +++ b/firmware/hw_layer/hardware.cpp @@ -232,8 +232,8 @@ void applyNewHardwareSettings(void) { // all 'stop' methods need to go before we begin starting pins - stopInjectionPins(); - stopIgnitionPins(); + enginePins.stopInjectionPins(); + enginePins.stopIgnitionPins(); stopCanPins(); bool etbRestartNeeded = isETBRestartNeeded(); if (etbRestartNeeded) { @@ -265,8 +265,8 @@ void applyNewHardwareSettings(void) { enginePins.unregisterPins(); - startInjectionPins(); - startIgnitionPins(); + enginePins.startInjectionPins(); + enginePins.startIgnitionPins(); startCanPins(); if (etbRestartNeeded) { startETBPins();