Output pin init/deinit needs a linked list #1803
This commit is contained in:
parent
c0ac1649e2
commit
256650aa88
|
@ -201,6 +201,11 @@ void EnginePins::unregisterPins() {
|
||||||
output.initPin(name, CONFIG(pin), &CONFIG(pinMode)); \
|
output.initPin(name, CONFIG(pin), &CONFIG(pinMode)); \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define initIfPinChanged(output, name, pin) \
|
||||||
|
if (isConfigurationChanged(pin)) { \
|
||||||
|
output.initPin(name, CONFIG(pin)); \
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void EnginePins::startPins(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
void EnginePins::startPins(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
#if EFI_ENGINE_CONTROL
|
#if EFI_ENGINE_CONTROL
|
||||||
|
@ -217,15 +222,15 @@ void EnginePins::startPins(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
initIfPinOrModeChanged(fanRelay, "Fan", fanPin, fanPinMode);
|
initIfPinOrModeChanged(fanRelay, "Fan", fanPin, fanPinMode);
|
||||||
initIfPinOrModeChanged(acRelay, "A/C relay", acRelayPin, acRelayPinMode);
|
initIfPinOrModeChanged(acRelay, "A/C relay", acRelayPin, acRelayPinMode);
|
||||||
// todo: should we move this code closer to the fuel pump logic?
|
// todo: should we move this code closer to the fuel pump logic?
|
||||||
fuelPumpRelay.initPin("Fuel pump", CONFIG(fuelPumpPin), &CONFIG(fuelPumpPinMode));
|
initIfPinOrModeChanged(fuelPumpRelay, "Fuel pump", fuelPumpPin, fuelPumpPinMode);
|
||||||
boostPin.initPin("Boost", CONFIG(boostControlPin));
|
initIfPinChanged(boostPin, "Boost", boostControlPin);
|
||||||
|
|
||||||
idleSolenoidPin.initPin("Idle Valve", CONFIG(idle).solenoidPin);
|
initIfPinChanged(idleSolenoidPin, "Idle Valve", idle.solenoidPin);
|
||||||
secondIdleSolenoidPin.initPin("Idle Valve#2", CONFIG(secondSolenoidPin));
|
initIfPinChanged(secondIdleSolenoidPin, "Idle Valve#2", secondSolenoidPin);
|
||||||
alternatorPin.initPin("Alternator control", CONFIG(alternatorControlPin));
|
initIfPinChanged(alternatorPin, "Alternator control", alternatorControlPin);
|
||||||
|
|
||||||
triggerDecoderErrorPin.initPin("led: trigger debug", CONFIG(triggerErrorPin),
|
initIfPinOrModeChanged(triggerDecoderErrorPin, "led: trigger debug", triggerErrorPin,
|
||||||
&CONFIG(triggerErrorPinMode));
|
triggerErrorPinMode);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue