Browse Source

Move G42 to cpp

Scott Lahteine 6 years ago
parent
commit
931aa79d85
4 changed files with 14 additions and 10 deletions
  1. 0
    4
      Marlin/src/Marlin.cpp
  2. 12
    1
      Marlin/src/gcode/bedlevel/G42.cpp
  3. 1
    4
      Marlin/src/gcode/gcode.cpp
  4. 1
    1
      Marlin/src/gcode/gcode.h

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

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

Marlin/src/gcode/probe/G42.h → Marlin/src/gcode/bedlevel/G42.cpp View File

@@ -20,10 +20,19 @@
20 20
  *
21 21
  */
22 22
 
23
+#include "../../inc/MarlinConfig.h"
24
+
25
+#if HAS_MESH
26
+
27
+#include "../gcode.h"
28
+#include "../../Marlin.h" // for IsRunning()
29
+#include "../../module/motion.h"
30
+#include "../../feature/bedlevel/bedlevel.h"
31
+
23 32
 /**
24 33
  * G42: Move X & Y axes to mesh coordinates (I & J)
25 34
  */
26
-void gcode_G42() {
35
+void GcodeSuite::G42() {
27 36
   if (IsRunning()) {
28 37
     const bool hasI = parser.seenval('I');
29 38
     const int8_t ix = hasI ? parser.value_int() : 0;
@@ -65,3 +74,5 @@ void gcode_G42() {
65 74
     #endif
66 75
   }
67 76
 }
77
+
78
+#endif // HAS_MESH

+ 1
- 4
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_G42();
120 119
 extern void gcode_G92();
121 120
 extern void gcode_M0_M1();
122 121
 extern void gcode_M3_M4(bool is_M3);
@@ -400,9 +399,7 @@ void GcodeSuite::process_next_command() {
400 399
         break;
401 400
 
402 401
       #if HAS_MESH
403
-        case 42:
404
-          gcode_G42();
405
-          break;
402
+        case 42: G42(); break;        // G42: Coordinated move to a mesh point
406 403
       #endif
407 404
 
408 405
       #if ENABLED(DEBUG_GCODE_PARSER)

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

@@ -64,7 +64,7 @@
64 64
  * G32  - Undock sled (Z_PROBE_SLED only)
65 65
  * G33  - Delta Auto-Calibration (Requires DELTA_AUTO_CALIBRATION)
66 66
  * G38  - Probe in any direction using the Z_MIN_PROBE (Requires G38_PROBE_TARGET)
67
- * G42  - Coordinated move to a mesh point (Requires AUTO_BED_LEVELING_UBL)
67
+ * G42  - Coordinated move to a mesh point (Requires HAS_MESH)
68 68
  * G90  - Use Absolute Coordinates
69 69
  * G91  - Use Relative Coordinates
70 70
  * G92  - Set current position to coordinates given

Loading…
Cancel
Save