From fd15b1495a7b5472cb766f59367d8c94251d4ed9 Mon Sep 17 00:00:00 2001 From: Roxy-3D Date: Mon, 13 Aug 2018 14:59:29 -0500 Subject: [PATCH] add I parameter to M42 to allow access to sensitive pins --- Marlin/src/gcode/control/M42.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Marlin/src/gcode/control/M42.cpp b/Marlin/src/gcode/control/M42.cpp index f197b6e37f..6e84dc475f 100644 --- a/Marlin/src/gcode/control/M42.cpp +++ b/Marlin/src/gcode/control/M42.cpp @@ -32,6 +32,7 @@ * P1_20 as M42 P120, etc. * * S Pin status from 0 - 255 + * I Flag to ignore Marlin's pin protection */ void GcodeSuite::M42() { if (!parser.seenval('S')) return; @@ -42,7 +43,7 @@ void GcodeSuite::M42() { const pin_t pin = GET_PIN_MAP_PIN(pin_index); - if (pin_is_protected(pin)) return protected_pin_err(); + if (!parser.boolval('I') && pin_is_protected(pin)) return protected_pin_err(); pinMode(pin, OUTPUT); digitalWrite(pin, pin_status);