Merge pull request #409 from andreika-git/boardTestModeJumperPin

boardTestModeJumperPin unassigned fix pull request
This commit is contained in:
rusefi 2017-05-06 15:38:56 -04:00 committed by GitHub
commit ce2d272727
1 changed files with 10 additions and 7 deletions

View File

@ -374,14 +374,17 @@ void initHardware(Logging *l) {
initTriggerDecoder(); initTriggerDecoder();
#endif #endif
mySetPadMode2("board test", boardConfiguration->boardTestModeJumperPin, bool isBoardTestMode_b;
PAL_MODE_INPUT_PULLUP); if (boardConfiguration->boardTestModeJumperPin != GPIO_UNASSIGNED) {
bool isBoardTestMode_b = (!palReadPad(getHwPort(boardConfiguration->boardTestModeJumperPin), getHwPin(boardConfiguration->boardTestModeJumperPin))); mySetPadMode2("board test", boardConfiguration->boardTestModeJumperPin,
PAL_MODE_INPUT_PULLUP);
// we can now relese this pin, it is actually used as output sometimes isBoardTestMode_b = (!palReadPad(getHwPort(boardConfiguration->boardTestModeJumperPin), getHwPin(boardConfiguration->boardTestModeJumperPin)));
unmarkPin(boardConfiguration->boardTestModeJumperPin);
// we can now relese this pin, it is actually used as output sometimes
unmarkPin(boardConfiguration->boardTestModeJumperPin);
} else {
isBoardTestMode_b = false;
}
#if HAL_USE_ADC || defined(__DOXYGEN__) #if HAL_USE_ADC || defined(__DOXYGEN__)
initAdcInputs(isBoardTestMode_b); initAdcInputs(isBoardTestMode_b);