Scott Lahteine před 7 roky
rodič
revize
10fab24e50

+ 1
- 3
Marlin/src/Marlin.cpp Zobrazit soubor

363
 /**
363
 /**
364
  * Sensitive pin test for M42, M226
364
  * Sensitive pin test for M42, M226
365
  */
365
  */
366
-static bool pin_is_protected(const int8_t pin) {
366
+bool pin_is_protected(const int8_t pin) {
367
   static const int8_t sensitive_pins[] PROGMEM = SENSITIVE_PINS;
367
   static const int8_t sensitive_pins[] PROGMEM = SENSITIVE_PINS;
368
   for (uint8_t i = 0; i < COUNT(sensitive_pins); i++)
368
   for (uint8_t i = 0; i < COUNT(sensitive_pins); i++)
369
     if (pin == (int8_t)pgm_read_byte(&sensitive_pins[i])) return true;
369
     if (pin == (int8_t)pgm_read_byte(&sensitive_pins[i])) return true;
370
   return false;
370
   return false;
371
 }
371
 }
372
 
372
 
373
-#include "gcode/control/M42.h"
374
-
375
 #if ENABLED(PINS_DEBUGGING)
373
 #if ENABLED(PINS_DEBUGGING)
376
   #include "gcode/config/M43.h"
374
   #include "gcode/config/M43.h"
377
 #endif
375
 #endif

+ 2
- 0
Marlin/src/Marlin.h Zobrazit soubor

228
 
228
 
229
 void calculate_volumetric_multipliers();
229
 void calculate_volumetric_multipliers();
230
 
230
 
231
+bool pin_is_protected(const int8_t pin);
232
+
231
 #endif // __MARLIN_H__
233
 #endif // __MARLIN_H__

Marlin/src/gcode/control/M42.h → Marlin/src/gcode/control/M42.cpp Zobrazit soubor

20
  *
20
  *
21
  */
21
  */
22
 
22
 
23
+#include "../gcode.h"
24
+#include "../../Marlin.h" // for pin_is_protected
25
+#include "../../inc/MarlinConfig.h"
26
+
23
 /**
27
 /**
24
  * M42: Change pin status via GCode
28
  * M42: Change pin status via GCode
25
  *
29
  *
26
  *  P<pin>  Pin number (LED if omitted)
30
  *  P<pin>  Pin number (LED if omitted)
27
  *  S<byte> Pin status from 0 - 255
31
  *  S<byte> Pin status from 0 - 255
28
  */
32
  */
29
-void gcode_M42() {
33
+void GcodeSuite::M42() {
30
   if (!parser.seenval('S')) return;
34
   if (!parser.seenval('S')) return;
31
   const byte pin_status = parser.value_byte();
35
   const byte pin_status = parser.value_byte();
32
 
36
 

+ 1
- 3
Marlin/src/gcode/gcode.cpp Zobrazit soubor

117
 // Placeholders for non-migrated codes
117
 // Placeholders for non-migrated codes
118
 //
118
 //
119
 extern void gcode_M18_M84();
119
 extern void gcode_M18_M84();
120
-extern void gcode_M42();
121
 extern void gcode_M43();
120
 extern void gcode_M43();
122
 extern void gcode_M48();
121
 extern void gcode_M48();
123
 extern void gcode_M75();
122
 extern void gcode_M75();
433
 
432
 
434
       case 31: M31(); break;      // M31: Report time since the start of SD print or last M109
433
       case 31: M31(); break;      // M31: Report time since the start of SD print or last M109
435
 
434
 
436
-      case 42: // M42: Change pin state
437
-        gcode_M42(); break;
435
+      case 42: M42(); break;      // M42: Change pin state
438
 
436
 
439
       #if ENABLED(PINS_DEBUGGING)
437
       #if ENABLED(PINS_DEBUGGING)
440
         case 43: // M43: Read pin state
438
         case 43: // M43: Read pin state

Loading…
Zrušit
Uložit