Browse Source

add I parameter to M42 to allow access to sensitive pins

Roxy-3D 6 years ago
parent
commit
fd15b1495a
1 changed files with 2 additions and 1 deletions
  1. 2
    1
      Marlin/src/gcode/control/M42.cpp

+ 2
- 1
Marlin/src/gcode/control/M42.cpp View File

@@ -32,6 +32,7 @@
32 32
  *                                  P1_20 as M42 P120, etc.
33 33
  *
34 34
  *  S<byte> Pin status from 0 - 255
35
+ *  I       Flag to ignore Marlin's pin protection
35 36
  */
36 37
 void GcodeSuite::M42() {
37 38
   if (!parser.seenval('S')) return;
@@ -42,7 +43,7 @@ void GcodeSuite::M42() {
42 43
 
43 44
   const pin_t pin = GET_PIN_MAP_PIN(pin_index);
44 45
 
45
-  if (pin_is_protected(pin)) return protected_pin_err();
46
+  if (!parser.boolval('I') && pin_is_protected(pin)) return protected_pin_err();
46 47
 
47 48
   pinMode(pin, OUTPUT);
48 49
   digitalWrite(pin, pin_status);

Loading…
Cancel
Save