Pārlūkot izejas kodu

Move M226 to cpp

Scott Lahteine 7 gadus atpakaļ
vecāks
revīzija
3e761696a0

+ 0
- 2
Marlin/src/Marlin.cpp Parādīt failu

355
   return false;
355
   return false;
356
 }
356
 }
357
 
357
 
358
-#include "gcode/control/M226.h"
359
-
360
 #if ENABLED(EXPERIMENTAL_I2CBUS)
358
 #if ENABLED(EXPERIMENTAL_I2CBUS)
361
   #include "gcode/feature/i2c/M260_M261.h"
359
   #include "gcode/feature/i2c/M260_M261.h"
362
 #endif
360
 #endif

Marlin/src/gcode/control/M226.h → Marlin/src/gcode/control/M226.cpp Parādīt failu

20
  *
20
  *
21
  */
21
  */
22
 
22
 
23
+#include "../gcode.h"
24
+#include "../../Marlin.h" // for pin_is_protected and idle()
25
+#include "../../module/stepper.h"
26
+
23
 /**
27
 /**
24
  * M226: Wait until the specified pin reaches the state required (M226 P<pin> S<state>)
28
  * M226: Wait until the specified pin reaches the state required (M226 P<pin> S<state>)
25
  */
29
  */
26
-void gcode_M226() {
30
+void GcodeSuite::M226() {
27
   if (parser.seen('P')) {
31
   if (parser.seen('P')) {
28
     const int pin_number = parser.value_int(),
32
     const int pin_number = parser.value_int(),
29
               pin_state = parser.intval('S', -1); // required pin state - default is inverted
33
               pin_state = parser.intval('S', -1); // required pin state - default is inverted

+ 1
- 4
Marlin/src/gcode/gcode.cpp Parādīt failu

119
 extern void gcode_M163();
119
 extern void gcode_M163();
120
 extern void gcode_M164();
120
 extern void gcode_M164();
121
 extern void gcode_M165();
121
 extern void gcode_M165();
122
-extern void gcode_M226();
123
 extern void gcode_M240();
122
 extern void gcode_M240();
124
 extern void gcode_M250();
123
 extern void gcode_M250();
125
 extern void gcode_M260();
124
 extern void gcode_M260();
564
         M221();
563
         M221();
565
         break;
564
         break;
566
 
565
 
567
-      case 226: // M226: Wait until a pin reaches a state
568
-        gcode_M226();
569
-        break;
566
+      case 226: M226(); break;    // M226: Wait until a pin reaches a state
570
 
567
 
571
       #if HAS_SERVOS
568
       #if HAS_SERVOS
572
         case 280: // M280: Set servo position absolute
569
         case 280: // M280: Set servo position absolute

Notiek ielāde…
Atcelt
Saglabāt