Browse Source

Move G42 to cpp

Scott Lahteine 6 years ago
parent
commit
931aa79d85

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

357
  ***************** GCode Handlers *****************
357
  ***************** GCode Handlers *****************
358
  **************************************************/
358
  **************************************************/
359
 
359
 
360
-#if HAS_MESH
361
-  #include "gcode/probe/G42.h"
362
-#endif
363
-
364
 #include "gcode/geometry/G92.h"
360
 #include "gcode/geometry/G92.h"
365
 
361
 
366
 #if HAS_RESUME_CONTINUE
362
 #if HAS_RESUME_CONTINUE

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

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
  * G42: Move X & Y axes to mesh coordinates (I & J)
33
  * G42: Move X & Y axes to mesh coordinates (I & J)
25
  */
34
  */
26
-void gcode_G42() {
35
+void GcodeSuite::G42() {
27
   if (IsRunning()) {
36
   if (IsRunning()) {
28
     const bool hasI = parser.seenval('I');
37
     const bool hasI = parser.seenval('I');
29
     const int8_t ix = hasI ? parser.value_int() : 0;
38
     const int8_t ix = hasI ? parser.value_int() : 0;
65
     #endif
74
     #endif
66
   }
75
   }
67
 }
76
 }
77
+
78
+#endif // HAS_MESH

+ 1
- 4
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_G42();
120
 extern void gcode_G92();
119
 extern void gcode_G92();
121
 extern void gcode_M0_M1();
120
 extern void gcode_M0_M1();
122
 extern void gcode_M3_M4(bool is_M3);
121
 extern void gcode_M3_M4(bool is_M3);
400
         break;
399
         break;
401
 
400
 
402
       #if HAS_MESH
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
       #endif
403
       #endif
407
 
404
 
408
       #if ENABLED(DEBUG_GCODE_PARSER)
405
       #if ENABLED(DEBUG_GCODE_PARSER)

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

64
  * G32  - Undock sled (Z_PROBE_SLED only)
64
  * G32  - Undock sled (Z_PROBE_SLED only)
65
  * G33  - Delta Auto-Calibration (Requires DELTA_AUTO_CALIBRATION)
65
  * G33  - Delta Auto-Calibration (Requires DELTA_AUTO_CALIBRATION)
66
  * G38  - Probe in any direction using the Z_MIN_PROBE (Requires G38_PROBE_TARGET)
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
  * G90  - Use Absolute Coordinates
68
  * G90  - Use Absolute Coordinates
69
  * G91  - Use Relative Coordinates
69
  * G91  - Use Relative Coordinates
70
  * G92  - Set current position to coordinates given
70
  * G92  - Set current position to coordinates given

Loading…
Cancel
Save