Browse Source

Move M119-M121 to cpp

Scott Lahteine 8 years ago
parent
commit
eef4a54778

+ 0
- 4
Marlin/src/Marlin.cpp View File

@@ -355,10 +355,6 @@ bool pin_is_protected(const int8_t pin) {
355 355
   return false;
356 356
 }
357 357
 
358
-#include "gcode/host/M119.h"
359
-
360
-#include "gcode/control/M120_M121.h"
361
-
362 358
 #if HAS_COLOR_LEDS
363 359
   #include "gcode/feature/leds/M150.h"
364 360
 #endif

Marlin/src/gcode/control/M120_M121.h → Marlin/src/gcode/control/M120_M121.cpp View File

@@ -20,20 +20,15 @@
20 20
  *
21 21
  */
22 22
 
23
+#include "../gcode.h"
24
+#include "../../module/endstops.h"
25
+
23 26
 /**
24 27
  * M120: Enable endstops and set non-homing endstop state to "enabled"
25 28
  */
26
-void gcode_M120() {
27
-
28
-  endstops.enable_globally(true);
29
-
30
-}
29
+void GcodeSuite::M120() { endstops.enable_globally(true); }
31 30
 
32 31
 /**
33 32
  * M121: Disable endstops and set non-homing endstop state to "disabled"
34 33
  */
35
-void gcode_M121() {
36
-
37
-  endstops.enable_globally(false);
38
-
39
-}
34
+void GcodeSuite::M121() { endstops.enable_globally(false); }

+ 3
- 12
Marlin/src/gcode/gcode.cpp View File

@@ -116,9 +116,6 @@ void GcodeSuite::dwell(millis_t time) {
116 116
 //
117 117
 // Placeholders for non-migrated codes
118 118
 //
119
-extern void gcode_M119();
120
-extern void gcode_M120();
121
-extern void gcode_M121();
122 119
 extern void gcode_M150();
123 120
 extern void gcode_M163();
124 121
 extern void gcode_M164();
@@ -499,15 +496,9 @@ void GcodeSuite::process_next_command() {
499 496
       case 117: M117(); break;    // M117: Set LCD message text, if possible
500 497
       case 118: M118(); break;    // M118: Display a message in the host console
501 498
 
502
-      case 119: // M119: Report endstop states
503
-        gcode_M119();
504
-        break;
505
-      case 120: // M120: Enable endstops
506
-        gcode_M120();
507
-        break;
508
-      case 121: // M121: Disable endstops
509
-        gcode_M121();
510
-        break;
499
+      case 119: M119(); break;    // M119: Report endstop states
500
+      case 120: M120(); break;    // M120: Enable endstops
501
+      case 121: M121(); break;    // M121: Disable endstops
511 502
 
512 503
       #if ENABLED(ULTIPANEL)
513 504
         case 145: M145(); break;  // M145: Set material heatup parameters

Marlin/src/gcode/host/M119.h → Marlin/src/gcode/host/M119.cpp View File

@@ -20,7 +20,14 @@
20 20
  *
21 21
  */
22 22
 
23
+#include "../gcode.h"
24
+#include "../../module/endstops.h"
25
+
23 26
 /**
24 27
  * M119: Output endstop states to serial output
25 28
  */
26
-void gcode_M119() { endstops.M119(); }
29
+void GcodeSuite::M119() {
30
+
31
+  endstops.M119();
32
+
33
+}

Loading…
Cancel
Save