Skip to content

Commit

Permalink
💥 Change 'M42 M' to 'M42 T'
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Feb 11, 2022
1 parent be8f4f4 commit df98bd2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Marlin/src/gcode/control/M42.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ void protected_pin_err() {
* S<byte> Pin status from 0 - 255
* I Flag to ignore Marlin's pin protection
*
* M<mode> Pin mode: 0=INPUT 1=OUTPUT 2=INPUT_PULLUP 3=INPUT_PULLDOWN
* T<mode> Pin mode: 0=INPUT 1=OUTPUT 2=INPUT_PULLUP 3=INPUT_PULLDOWN
*/
void GcodeSuite::M42() {
const int pin_index = PARSED_PIN_INDEX('P', GET_PIN_MAP_INDEX(LED_PIN));
Expand All @@ -63,7 +63,7 @@ void GcodeSuite::M42() {
if (!parser.boolval('I') && pin_is_protected(pin)) return protected_pin_err();

bool avoidWrite = false;
if (parser.seenval('M')) {
if (parser.seenval('T')) {
switch (parser.value_byte()) {
case 0: pinMode(pin, INPUT); avoidWrite = true; break;
case 1: pinMode(pin, OUTPUT); break;
Expand Down

0 comments on commit df98bd2

Please sign in to comment.