Move G42 to cpp

This commit is contained in:
Scott Lahteine 2017-09-16 00:04:21 -05:00
parent 84ddae56a8
commit 931aa79d85
4 changed files with 14 additions and 10 deletions

View File

@ -357,10 +357,6 @@ void suicide() {
***************** GCode Handlers ***************** ***************** GCode Handlers *****************
**************************************************/ **************************************************/
#if HAS_MESH
#include "gcode/probe/G42.h"
#endif
#include "gcode/geometry/G92.h" #include "gcode/geometry/G92.h"
#if HAS_RESUME_CONTINUE #if HAS_RESUME_CONTINUE

View File

@ -20,10 +20,19 @@
* *
*/ */
#include "../../inc/MarlinConfig.h"
#if HAS_MESH
#include "../gcode.h"
#include "../../Marlin.h" // for IsRunning()
#include "../../module/motion.h"
#include "../../feature/bedlevel/bedlevel.h"
/** /**
* G42: Move X & Y axes to mesh coordinates (I & J) * G42: Move X & Y axes to mesh coordinates (I & J)
*/ */
void gcode_G42() { void GcodeSuite::G42() {
if (IsRunning()) { if (IsRunning()) {
const bool hasI = parser.seenval('I'); const bool hasI = parser.seenval('I');
const int8_t ix = hasI ? parser.value_int() : 0; const int8_t ix = hasI ? parser.value_int() : 0;
@ -65,3 +74,5 @@ void gcode_G42() {
#endif #endif
} }
} }
#endif // HAS_MESH

View File

@ -116,7 +116,6 @@ void GcodeSuite::dwell(millis_t time) {
// //
// Placeholders for non-migrated codes // Placeholders for non-migrated codes
// //
extern void gcode_G42();
extern void gcode_G92(); extern void gcode_G92();
extern void gcode_M0_M1(); extern void gcode_M0_M1();
extern void gcode_M3_M4(bool is_M3); extern void gcode_M3_M4(bool is_M3);
@ -400,9 +399,7 @@ void GcodeSuite::process_next_command() {
break; break;
#if HAS_MESH #if HAS_MESH
case 42: case 42: G42(); break; // G42: Coordinated move to a mesh point
gcode_G42();
break;
#endif #endif
#if ENABLED(DEBUG_GCODE_PARSER) #if ENABLED(DEBUG_GCODE_PARSER)

View File

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