Explorar el Código

Move G30 to cpp

Scott Lahteine hace 7 años
padre
commit
9db5d21837
Se han modificado 3 ficheros con 15 adiciones y 8 borrados
  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 Ver fichero

@@ -357,11 +357,8 @@ void suicide() {
357 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 362
 #endif
366 363
 
367 364
 #if ENABLED(G38_PROBE_TARGET)

+ 1
- 2
Marlin/src/gcode/gcode.cpp Ver fichero

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

Marlin/src/gcode/probe/G30.h → Marlin/src/gcode/probe/G30.cpp Ver fichero

@@ -20,6 +20,15 @@
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 33
  * G30: Do a single Z probe at the current XY
25 34
  *
@@ -29,7 +38,7 @@
29 38
  *   Y   Probe Y position (default current Y)
30 39
  *   S0  Leave the probe deployed
31 40
  */
32
-void gcode_G30() {
41
+void GcodeSuite::G30() {
33 42
   const float xpos = parser.linearval('X', current_position[X_AXIS] + X_PROBE_OFFSET_FROM_EXTRUDER),
34 43
               ypos = parser.linearval('Y', current_position[Y_AXIS] + Y_PROBE_OFFSET_FROM_EXTRUDER);
35 44
 
@@ -54,3 +63,5 @@ void gcode_G30() {
54 63
 
55 64
   report_current_position();
56 65
 }
66
+
67
+#endif // HAS_BED_PROBE

Loading…
Cancelar
Guardar