Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions Marlin/src/gcode/control/M42.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,20 @@ void GcodeSuite::M42() {
case 0: pinMode(pin, INPUT); avoidWrite = true; break;
case 1: pinMode(pin, OUTPUT); break;
case 2: pinMode(pin, INPUT_PULLUP); avoidWrite = true; break;
#ifdef INPUT_PULLDOWN
case 3: pinMode(pin, INPUT_PULLDOWN); avoidWrite = true; break;
#endif
#ifdef INPUT_ANALOG
case 4: pinMode(pin, INPUT_ANALOG); avoidWrite = true; break;
#endif
case 3:
#ifdef INPUT_PULLDOWN
pinMode(pin, INPUT_PULLDOWN);
avoidWrite = true;
#endif
break;
case 4:
#ifdef INPUT_ANALOG // STM32
pinMode(pin, INPUT_ANALOG);
#elif defined(MAPLE_STM32F1)
_SET_MODE(pin, GPIO_INPUT_ANALOG);
#endif
avoidWrite = true;
break;
#ifdef OUTPUT_OPEN_DRAIN
case 5: pinMode(pin, OUTPUT_OPEN_DRAIN); break;
#endif
Expand Down