Output pin init/deinit needs a linked list #1803

This commit is contained in:
rusefillc 2020-11-03 12:28:13 -05:00
parent 885d28e0e4
commit a7c97b3508
1 changed files with 4 additions and 10 deletions

View File

@ -201,12 +201,6 @@ void EnginePins::unregisterPins() {
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) {
#if EFI_ENGINE_CONTROL
startInjectionPins();
@ -223,11 +217,11 @@ void EnginePins::startPins(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
initIfPinOrModeChanged(acRelay, "A/C relay", acRelayPin, acRelayPinMode);
// todo: should we move this code closer to the fuel pump logic?
initIfPinOrModeChanged(fuelPumpRelay, "Fuel pump", fuelPumpPin, fuelPumpPinMode);
initIfPinChanged(boostPin, "Boost", boostControlPin);
initIfPinOrModeChanged(boostPin, "Boost", boostControlPin, boostControlPinMode);
initIfPinChanged(idleSolenoidPin, "Idle Valve", idle.solenoidPin);
initIfPinChanged(secondIdleSolenoidPin, "Idle Valve#2", secondSolenoidPin);
initIfPinChanged(alternatorPin, "Alternator control", alternatorControlPin);
initIfPinOrModeChanged(idleSolenoidPin, "Idle Valve", idle.solenoidPin, idle.solenoidPinMode);
initIfPinOrModeChanged(secondIdleSolenoidPin, "Idle Valve#2", secondSolenoidPin, idle.solenoidPinMode);
initIfPinOrModeChanged(alternatorPin, "Alternator control", alternatorControlPin, alternatorControlPinMode);
initIfPinOrModeChanged(triggerDecoderErrorPin, "led: trigger debug", triggerErrorPin,
triggerErrorPinMode);