Browse Source

Move M666 to cpp

Scott Lahteine 8 years ago
parent
commit
6c7bad8bc3
3 changed files with 18 additions and 12 deletions
  1. 0
    4
      Marlin/src/Marlin.cpp
  2. 17
    4
      Marlin/src/gcode/calibrate/M666.cpp
  3. 1
    4
      Marlin/src/gcode/gcode.cpp

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

355
   return false;
355
   return false;
356
 }
356
 }
357
 
357
 
358
-#if ENABLED(DELTA) || ENABLED(Z_DUAL_ENDSTOPS)
359
-  #include "gcode/calibrate/M666.h"
360
-#endif
361
-
362
 #include "gcode/control/M211.h"
358
 #include "gcode/control/M211.h"
363
 
359
 
364
 #include "gcode/config/M220.h"
360
 #include "gcode/config/M220.h"

Marlin/src/gcode/calibrate/M666.h → Marlin/src/gcode/calibrate/M666.cpp View File

20
  *
20
  *
21
  */
21
  */
22
 
22
 
23
+#include "../../inc/MarlinConfig.h"
24
+
25
+#if ENABLED(DELTA) || ENABLED(Z_DUAL_ENDSTOPS)
26
+
27
+#include "../gcode.h"
28
+
23
 #if ENABLED(DELTA)
29
 #if ENABLED(DELTA)
24
 
30
 
31
+  #include "../../module/delta.h"
32
+  #include "../../module/motion.h"
33
+
25
   /**
34
   /**
26
    * M666: Set delta endstop adjustment
35
    * M666: Set delta endstop adjustment
27
    */
36
    */
28
-  void gcode_M666() {
37
+  void GcodeSuite::M666() {
29
     #if ENABLED(DEBUG_LEVELING_FEATURE)
38
     #if ENABLED(DEBUG_LEVELING_FEATURE)
30
       if (DEBUGGING(LEVELING)) {
39
       if (DEBUGGING(LEVELING)) {
31
-        SERIAL_ECHOLNPGM(">>> gcode_M666");
40
+        SERIAL_ECHOLNPGM(">>> M666");
32
       }
41
       }
33
     #endif
42
     #endif
34
     LOOP_XYZ(i) {
43
     LOOP_XYZ(i) {
44
     }
53
     }
45
     #if ENABLED(DEBUG_LEVELING_FEATURE)
54
     #if ENABLED(DEBUG_LEVELING_FEATURE)
46
       if (DEBUGGING(LEVELING)) {
55
       if (DEBUGGING(LEVELING)) {
47
-        SERIAL_ECHOLNPGM("<<< gcode_M666");
56
+        SERIAL_ECHOLNPGM("<<< M666");
48
       }
57
       }
49
     #endif
58
     #endif
50
     // normalize endstops so all are <=0; set the residue to delta height
59
     // normalize endstops so all are <=0; set the residue to delta height
55
 
64
 
56
 #elif ENABLED(Z_DUAL_ENDSTOPS) // !DELTA && ENABLED(Z_DUAL_ENDSTOPS)
65
 #elif ENABLED(Z_DUAL_ENDSTOPS) // !DELTA && ENABLED(Z_DUAL_ENDSTOPS)
57
 
66
 
67
+  #include "../../Marlin.h" // for z_endstop_adj
68
+
58
   /**
69
   /**
59
    * M666: For Z Dual Endstop setup, set z axis offset to the z2 axis.
70
    * M666: For Z Dual Endstop setup, set z axis offset to the z2 axis.
60
    */
71
    */
61
-  void gcode_M666() {
72
+  void GcodeSuite::M666() {
62
     if (parser.seen('Z')) z_endstop_adj = parser.value_linear_units();
73
     if (parser.seen('Z')) z_endstop_adj = parser.value_linear_units();
63
     SERIAL_ECHOLNPAIR("Z Endstop Adjustment set to (mm):", z_endstop_adj);
74
     SERIAL_ECHOLNPAIR("Z Endstop Adjustment set to (mm):", z_endstop_adj);
64
   }
75
   }
65
 
76
 
66
 #endif
77
 #endif
78
+
79
+#endif // DELTA || Z_DUAL_ENDSTOPS

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

151
 extern void gcode_M503();
151
 extern void gcode_M503();
152
 extern void gcode_M540();
152
 extern void gcode_M540();
153
 extern void gcode_M605();
153
 extern void gcode_M605();
154
-extern void gcode_M666();
155
 extern void gcode_M702();
154
 extern void gcode_M702();
156
 extern void gcode_M900();
155
 extern void gcode_M900();
157
 extern void gcode_M906();
156
 extern void gcode_M906();
544
       #endif
543
       #endif
545
 
544
 
546
       #if ENABLED(DELTA) || ENABLED(Z_DUAL_ENDSTOPS)
545
       #if ENABLED(DELTA) || ENABLED(Z_DUAL_ENDSTOPS)
547
-        case 666: // M666: Set delta or dual endstop adjustment
548
-          gcode_M666();
549
-          break;
546
+        case 666: M666(); break;  // M666: Set delta or dual endstop adjustment
550
       #endif
547
       #endif
551
 
548
 
552
       #if ENABLED(FWRETRACT)
549
       #if ENABLED(FWRETRACT)

Loading…
Cancel
Save