This commit is contained in:
Matthew Kennedy 2019-07-03 00:18:04 -07:00 committed by rusefi
parent ae5da75cd8
commit e81beaf81b
1 changed files with 5 additions and 2 deletions

View File

@ -468,9 +468,12 @@ void OutputPin::initPin(const char *msg, brain_pin_e brainPin, const pin_output_
this->currentLogicValue = INITIAL_PIN_STATE;
efiSetPadMode(msg, brainPin, mode);
// The order of the next two calls may look strange, which is a good observation.
// We call them in this order so that the pin is set to a known state BEFORE
// it's enabled. Enabling the pin then setting it could result in a (brief)
// mystery state being driven on the pin (potentially dangerous).
setDefaultPinState(outputMode);
efiSetPadMode(msg, brainPin, mode);
#endif /* EFI_GPIO_HARDWARE */
}