Quellcode durchsuchen

Move M108, M112, M410 to cpp

Scott Lahteine vor 7 Jahren
Ursprung
Commit
5b3e49babd

+ 0
- 6
Marlin/src/Marlin.cpp Datei anzeigen

@@ -374,12 +374,6 @@ bool pin_is_protected(const int8_t pin) {
374 374
   return false;
375 375
 }
376 376
 
377
-#if DISABLED(EMERGENCY_PARSER)
378
-  #include "gcode/control/M108.h"
379
-  #include "gcode/control/M112.h"
380
-  #include "gcode/control/M410.h"
381
-#endif
382
-
383 377
 #if HAS_TEMP_BED
384 378
   #include "gcode/temperature/M190.h"
385 379
 #endif

Marlin/src/gcode/control/M108.h → Marlin/src/gcode/control/M108.cpp Datei anzeigen

@@ -20,11 +20,20 @@
20 20
  *
21 21
  */
22 22
 
23
+#include "../../inc/MarlinConfig.h"
24
+
25
+#if DISABLED(EMERGENCY_PARSER)
26
+
27
+#include "../gcode.h"
28
+#include "../../Marlin.h" // for wait_for_heatup
29
+
23 30
 /**
24 31
  * M108: Stop the waiting for heaters in M109, M190, M303. Does not affect the target temperature.
25 32
  */
26
-void gcode_M108() {
33
+void GcodeSuite::M108() {
27 34
 
28 35
   wait_for_heatup = false;
29 36
 
30 37
 }
38
+
39
+#endif // !EMERGENCY_PARSER

Marlin/src/gcode/control/M112.h → Marlin/src/gcode/control/M112.cpp Datei anzeigen

@@ -20,11 +20,20 @@
20 20
  *
21 21
  */
22 22
 
23
+#include "../../inc/MarlinConfig.h"
24
+
25
+#if DISABLED(EMERGENCY_PARSER)
26
+
27
+#include "../gcode.h"
28
+#include "../../Marlin.h" // for kill
29
+
23 30
 /**
24 31
  * M112: Emergency Stop
25 32
  */
26
-void gcode_M112() {
33
+void GcodeSuite::M112() {
27 34
 
28 35
   kill(PSTR(MSG_KILLED));
29 36
 
30 37
 }
38
+
39
+#endif // !EMERGENCY_PARSER

Marlin/src/gcode/control/M410.h → Marlin/src/gcode/control/M410.cpp Datei anzeigen

@@ -20,14 +20,23 @@
20 20
  *
21 21
  */
22 22
 
23
+#include "../../inc/MarlinConfig.h"
24
+
25
+#if DISABLED(EMERGENCY_PARSER)
26
+
27
+#include "../gcode.h"
28
+#include "../../Marlin.h" // for quickstop_stepper
29
+
23 30
 /**
24 31
  * M410: Quickstop - Abort all planned moves
25 32
  *
26 33
  * This will stop the carriages mid-move, so most likely they
27 34
  * will be out of sync with the stepper position after this.
28 35
  */
29
-void gcode_M410() {
36
+void GcodeSuite::M410() {
30 37
 
31 38
   quickstop_stepper();
32 39
 
33 40
 }
41
+
42
+#endif // !EMERGENCY_PARSER

+ 3
- 16
Marlin/src/gcode/gcode.cpp Datei anzeigen

@@ -124,10 +124,8 @@ extern void gcode_M83();
124 124
 extern void gcode_M85();
125 125
 extern void gcode_M92();
126 126
 extern void gcode_M100();
127
-extern void gcode_M108();
128 127
 extern void gcode_M110();
129 128
 extern void gcode_M111();
130
-extern void gcode_M112();
131 129
 extern void gcode_M113();
132 130
 extern void gcode_M114();
133 131
 extern void gcode_M115();
@@ -178,7 +176,6 @@ extern void gcode_M381();
178 176
 extern void gcode_M400();
179 177
 extern void gcode_M401();
180 178
 extern void gcode_M402();
181
-extern void gcode_M410();
182 179
 extern void gcode_M428();
183 180
 extern void gcode_M500();
184 181
 extern void gcode_M501();
@@ -462,19 +459,9 @@ void GcodeSuite::process_next_command() {
462 459
         break;
463 460
 
464 461
       #if DISABLED(EMERGENCY_PARSER)
465
-
466
-        case 108: // M108: Cancel Waiting
467
-          gcode_M108();
468
-          break;
469
-
470
-        case 112: // M112: Emergency Stop
471
-          gcode_M112();
472
-          break;
473
-
474
-        case 410: // M410 quickstop - Abort all the planned moves.
475
-          gcode_M410();
476
-          break;
477
-
462
+        case 108: M108(); break;  // M108: Cancel Waiting
463
+        case 112: M112(); break;  // M112: Emergency Stop
464
+        case 410: M410(); break;  // M410: Quickstop - Abort all the planned moves.
478 465
       #endif
479 466
 
480 467
       #if ENABLED(HOST_KEEPALIVE_FEATURE)

+ 2
- 8
Marlin/src/gcode/gcode.h Datei anzeigen

@@ -466,6 +466,8 @@ private:
466 466
 
467 467
   #if DISABLED(EMERGENCY_PARSER)
468 468
     static void M108();
469
+    static void M112();
470
+    static void M410();
469 471
   #endif
470 472
 
471 473
   static void M109();
@@ -473,10 +475,6 @@ private:
473 475
   static void M110();
474 476
   static void M111();
475 477
 
476
-  #if DISABLED(EMERGENCY_PARSER)
477
-    static void M112();
478
-  #endif
479
-
480 478
   #if ENABLED(HOST_KEEPALIVE_FEATURE)
481 479
     static void M113();
482 480
   #endif
@@ -638,10 +636,6 @@ private:
638 636
     static void M407();
639 637
   #endif
640 638
 
641
-  #if DISABLED(EMERGENCY_PARSER)
642
-    static void M410();
643
-  #endif
644
-
645 639
   #if HAS_LEVELING
646 640
     static void M420();
647 641
     static void M421();

Laden…
Abbrechen
Speichern