Browse Source

Move G30 to cpp

Scott Lahteine 8 years ago
parent
commit
9db5d21837
3 changed files with 15 additions and 8 deletions
  1. 2
    5
      Marlin/src/Marlin.cpp
  2. 1
    2
      Marlin/src/gcode/gcode.cpp
  3. 12
    1
      Marlin/src/gcode/probe/G30.cpp

+ 2
- 5
Marlin/src/Marlin.cpp View File

357
  ***************** GCode Handlers *****************
357
  ***************** GCode Handlers *****************
358
  **************************************************/
358
  **************************************************/
359
 
359
 
360
-#if HAS_BED_PROBE
361
-  #include "gcode/probe/G30.h"
362
-  #if ENABLED(Z_PROBE_SLED)
363
-    #include "gcode/probe/G31_G32.h"
364
-  #endif
360
+#if ENABLED(Z_PROBE_SLED)
361
+  #include "gcode/probe/G31_G32.h"
365
 #endif
362
 #endif
366
 
363
 
367
 #if ENABLED(G38_PROBE_TARGET)
364
 #if ENABLED(G38_PROBE_TARGET)

+ 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_G30();
120
 extern void gcode_G31();
119
 extern void gcode_G31();
121
 extern void gcode_G32();
120
 extern void gcode_G32();
122
 extern void gcode_G38(bool is_38_2);
121
 extern void gcode_G38(bool is_38_2);
362
       #if HAS_BED_PROBE
361
       #if HAS_BED_PROBE
363
 
362
 
364
         case 30: // G30 Single Z probe
363
         case 30: // G30 Single Z probe
365
-          gcode_G30();
364
+          G30();
366
           break;
365
           break;
367
 
366
 
368
         #if ENABLED(Z_PROBE_SLED)
367
         #if ENABLED(Z_PROBE_SLED)

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

20
  *
20
  *
21
  */
21
  */
22
 
22
 
23
+#include "../../inc/MarlinConfig.h"
24
+
25
+#if HAS_BED_PROBE
26
+
27
+#include "../gcode.h"
28
+#include "../../module/motion.h"
29
+#include "../../module/probe.h"
30
+#include "../../feature/bedlevel/bedlevel.h"
31
+
23
 /**
32
 /**
24
  * G30: Do a single Z probe at the current XY
33
  * G30: Do a single Z probe at the current XY
25
  *
34
  *
29
  *   Y   Probe Y position (default current Y)
38
  *   Y   Probe Y position (default current Y)
30
  *   S0  Leave the probe deployed
39
  *   S0  Leave the probe deployed
31
  */
40
  */
32
-void gcode_G30() {
41
+void GcodeSuite::G30() {
33
   const float xpos = parser.linearval('X', current_position[X_AXIS] + X_PROBE_OFFSET_FROM_EXTRUDER),
42
   const float xpos = parser.linearval('X', current_position[X_AXIS] + X_PROBE_OFFSET_FROM_EXTRUDER),
34
               ypos = parser.linearval('Y', current_position[Y_AXIS] + Y_PROBE_OFFSET_FROM_EXTRUDER);
43
               ypos = parser.linearval('Y', current_position[Y_AXIS] + Y_PROBE_OFFSET_FROM_EXTRUDER);
35
 
44
 
54
 
63
 
55
   report_current_position();
64
   report_current_position();
56
 }
65
 }
66
+
67
+#endif // HAS_BED_PROBE

Loading…
Cancel
Save