Browse Source

Move M206 to cpp

Scott Lahteine 7 years ago
parent
commit
33861d4e04
3 changed files with 11 additions and 9 deletions
  1. 0
    4
      Marlin/src/Marlin.cpp
  2. 1
    4
      Marlin/src/gcode/gcode.cpp
  3. 10
    1
      Marlin/src/gcode/geometry/M206.cpp

+ 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
-#if HAS_M206_COMMAND
359
-  #include "gcode/geometry/M206.h"
360
-#endif
361
-
362 358
 #if IS_KINEMATIC
363 359
   #include "gcode/calibrate/M665.h"
364 360
 #endif

+ 1
- 4
Marlin/src/gcode/gcode.cpp View File

@@ -119,7 +119,6 @@ void GcodeSuite::dwell(millis_t time) {
119 119
 extern void gcode_M163();
120 120
 extern void gcode_M164();
121 121
 extern void gcode_M165();
122
-extern void gcode_M206();
123 122
 extern void gcode_M211();
124 123
 extern void gcode_M220();
125 124
 extern void gcode_M226();
@@ -538,9 +537,7 @@ void GcodeSuite::process_next_command() {
538 537
       case 205: M205(); break;    // M205: Set advanced settings
539 538
 
540 539
       #if HAS_M206_COMMAND
541
-        case 206: // M206: Set home offsets
542
-          gcode_M206();
543
-          break;
540
+        case 206: M206(); break;  // M206: Set home offsets
544 541
       #endif
545 542
 
546 543
       #if ENABLED(DELTA)

Marlin/src/gcode/geometry/M206.h → Marlin/src/gcode/geometry/M206.cpp View File

@@ -20,6 +20,13 @@
20 20
  *
21 21
  */
22 22
 
23
+#include "../../inc/MarlinConfig.h"
24
+
25
+#if HAS_M206_COMMAND
26
+
27
+#include "../gcode.h"
28
+#include "../../module/motion.h"
29
+
23 30
 /**
24 31
  * M206: Set Additional Homing Offset (X Y Z). SCARA aliases T=X, P=Y
25 32
  *
@@ -27,7 +34,7 @@
27 34
  * ***              M206 for SCARA will remain enabled in 1.1.x for compatibility.
28 35
  * ***              In the 2.0 release, it will simply be disabled by default.
29 36
  */
30
-void gcode_M206() {
37
+void GcodeSuite::M206() {
31 38
   LOOP_XYZ(i)
32 39
     if (parser.seen(axis_codes[i]))
33 40
       set_home_offset((AxisEnum)i, parser.value_linear_units());
@@ -40,3 +47,5 @@ void gcode_M206() {
40 47
   SYNC_PLAN_POSITION_KINEMATIC();
41 48
   report_current_position();
42 49
 }
50
+
51
+#endif // HAS_M206_COMMAND

Loading…
Cancel
Save