Starter is engaged on start-up in pull-up configuration #1969

This commit is contained in:
rusefi 2020-11-26 00:16:59 -05:00
parent 63900429a6
commit 1238758c0f
2 changed files with 6 additions and 3 deletions

View File

@ -563,7 +563,7 @@ void OutputPin::unregisterOutput(brain_pin_e oldPin) {
if (oldPin != GPIO_UNASSIGNED) {
scheduleMsg(logger, "unregistering %s", hwPortname(oldPin));
#if EFI_GPIO_HARDWARE && EFI_PROD_CODE
brain_pin_markUnused(oldPin);
efiSetPadUnused(oldPin);
port = nullptr;
#endif /* EFI_GPIO_HARDWARE */
}

View File

@ -58,7 +58,7 @@ void efiSetPadMode(const char *msg, brain_pin_e brainPin, iomode_t mode)
if (!wasUsed) {
/*check if on-chip pin or external */
if (brain_pin_is_onchip(brainPin)) {
/* on-cip */
/* on-chip */
ioportid_t port = getHwPort(msg, brainPin);
ioportmask_t pin = getHwPin(msg, brainPin);
/* paranoid */
@ -84,8 +84,11 @@ void efiSetPadUnused(brain_pin_e brainPin)
ioportid_t port = getHwPort("unused", brainPin);
ioportmask_t pin = getHwPin("unused", brainPin);
/* input with pull up, is it safe? */
/* input with pull up, is it safe?
* todo: shall we reuse 'default state' constants with board.h?
* */
palSetPadMode(port, pin, mode);
palWritePad(port, pin, false);
}
#if (BOARD_EXT_GPIOCHIPS > 0)
else {