Browse Source

add I parameter to M42 to allow access to sensitive pins

Roxy-3D 7 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
  *                                  P1_20 as M42 P120, etc.
32
  *                                  P1_20 as M42 P120, etc.
33
  *
33
  *
34
  *  S<byte> Pin status from 0 - 255
34
  *  S<byte> Pin status from 0 - 255
35
+ *  I       Flag to ignore Marlin's pin protection
35
  */
36
  */
36
 void GcodeSuite::M42() {
37
 void GcodeSuite::M42() {
37
   if (!parser.seenval('S')) return;
38
   if (!parser.seenval('S')) return;
42
 
43
 
43
   const pin_t pin = GET_PIN_MAP_PIN(pin_index);
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
   pinMode(pin, OUTPUT);
48
   pinMode(pin, OUTPUT);
48
   digitalWrite(pin, pin_status);
49
   digitalWrite(pin, pin_status);

Loading…
Cancel
Save