Browse Source

Move G38 to cpp

Scott Lahteine 8 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
  ***************** GCode Handlers *****************
357
  ***************** GCode Handlers *****************
358
  **************************************************/
358
  **************************************************/
359
 
359
 
360
-#if ENABLED(G38_PROBE_TARGET)
361
-  #include "gcode/probe/G38.h"
362
-#endif
363
-
364
 #if HAS_MESH
360
 #if HAS_MESH
365
   #include "gcode/probe/G42.h"
361
   #include "gcode/probe/G42.h"
366
 #endif
362
 #endif

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

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

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

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

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

20
  *
20
  *
21
  */
21
  */
22
 
22
 
23
+#include "../../inc/MarlinConfig.h"
24
+
25
+#if ENABLED(G38_PROBE_TARGET)
26
+
23
 #include "../gcode.h"
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
 static bool G38_run_probe() {
34
 static bool G38_run_probe() {
26
 
35
 
27
   bool G38_pass_fail = false;
36
   bool G38_pass_fail = false;
88
  *
97
  *
89
  * Like G28 except uses Z min probe for all axes
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
   // Get X Y Z E F
101
   // Get X Y Z E F
93
-  gcode.get_destination_from_command();
102
+  get_destination_from_command();
94
 
103
 
95
   setup_for_endstop_or_probe_move();
104
   setup_for_endstop_or_probe_move();
96
 
105
 
108
 
117
 
109
   clean_up_after_endstop_or_probe_move();
118
   clean_up_after_endstop_or_probe_move();
110
 }
119
 }
120
+
121
+#endif // G38_PROBE_TARGET

Loading…
Cancel
Save