refactoring
This commit is contained in:
parent
c08140d112
commit
89c25af9d2
|
@ -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);
|
||||
|
|
|
@ -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_ */
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue