Browse Source

Move G38 to cpp

Scott Lahteine 6 years ago
parent
commit
84ddae56a8
4 changed files with 15 additions and 9 deletions
  1. 0
    4
      Marlin/src/Marlin.cpp
  2. 1
    2
      Marlin/src/gcode/gcode.cpp
  3. 1
    1
      Marlin/src/gcode/gcode.h
  4. 13
    2
      Marlin/src/gcode/probe/G38.cpp

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

@@ -357,10 +357,6 @@ void suicide() {
357 357
  ***************** GCode Handlers *****************
358 358
  **************************************************/
359 359
 
360
-#if ENABLED(G38_PROBE_TARGET)
361
-  #include "gcode/probe/G38.h"
362
-#endif
363
-
364 360
 #if HAS_MESH
365 361
   #include "gcode/probe/G42.h"
366 362
 #endif

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

@@ -116,7 +116,6 @@ void GcodeSuite::dwell(millis_t time) {
116 116
 //
117 117
 // Placeholders for non-migrated codes
118 118
 //
119
-extern void gcode_G38(bool is_38_2);
120 119
 extern void gcode_G42();
121 120
 extern void gcode_G92();
122 121
 extern void gcode_M0_M1();
@@ -385,7 +384,7 @@ void GcodeSuite::process_next_command() {
385 384
       #if ENABLED(G38_PROBE_TARGET)
386 385
         case 38: // G38.2 & G38.3
387 386
           if (parser.subcode == 2 || parser.subcode == 3)
388
-            gcode_G38(parser.subcode == 2);
387
+            G38(parser.subcode == 2);
389 388
           break;
390 389
       #endif
391 390
 

+ 1
- 1
Marlin/src/gcode/gcode.h View File

@@ -375,7 +375,7 @@ private:
375 375
   #endif
376 376
 
377 377
   #if ENABLED(G38_PROBE_TARGET)
378
-    static void G38(bool is_38_2);
378
+    static void G38(const bool is_38_2);
379 379
   #endif
380 380
 
381 381
   #if HAS_MESH

Marlin/src/gcode/probe/G38.h → Marlin/src/gcode/probe/G38.cpp View File

@@ -20,8 +20,17 @@
20 20
  *
21 21
  */
22 22
 
23
+#include "../../inc/MarlinConfig.h"
24
+
25
+#if ENABLED(G38_PROBE_TARGET)
26
+
23 27
 #include "../gcode.h"
24 28
 
29
+#include "../../module/endstops.h"
30
+#include "../../module/motion.h"
31
+#include "../../module/stepper.h"
32
+#include "../../module/probe.h"
33
+
25 34
 static bool G38_run_probe() {
26 35
 
27 36
   bool G38_pass_fail = false;
@@ -88,9 +97,9 @@ static bool G38_run_probe() {
88 97
  *
89 98
  * Like G28 except uses Z min probe for all axes
90 99
  */
91
-void gcode_G38(bool is_38_2) {
100
+void GcodeSuite::G38(const bool is_38_2) {
92 101
   // Get X Y Z E F
93
-  gcode.get_destination_from_command();
102
+  get_destination_from_command();
94 103
 
95 104
   setup_for_endstop_or_probe_move();
96 105
 
@@ -108,3 +117,5 @@ void gcode_G38(bool is_38_2) {
108 117
 
109 118
   clean_up_after_endstop_or_probe_move();
110 119
 }
120
+
121
+#endif // G38_PROBE_TARGET

Loading…
Cancel
Save