Browse Source

Move G30 to cpp

pull/1/head
Scott Lahteine 7 years ago
parent
commit
9db5d21837
  1. 3
      Marlin/src/Marlin.cpp
  2. 3
      Marlin/src/gcode/gcode.cpp
  3. 13
      Marlin/src/gcode/probe/G30.cpp

3
Marlin/src/Marlin.cpp

@ -357,12 +357,9 @@ void suicide() {
***************** GCode Handlers ***************** ***************** GCode Handlers *****************
**************************************************/ **************************************************/
#if HAS_BED_PROBE
#include "gcode/probe/G30.h"
#if ENABLED(Z_PROBE_SLED) #if ENABLED(Z_PROBE_SLED)
#include "gcode/probe/G31_G32.h" #include "gcode/probe/G31_G32.h"
#endif #endif
#endif
#if ENABLED(G38_PROBE_TARGET) #if ENABLED(G38_PROBE_TARGET)
#include "gcode/probe/G38.h" #include "gcode/probe/G38.h"

3
Marlin/src/gcode/gcode.cpp

@ -116,7 +116,6 @@ void GcodeSuite::dwell(millis_t time) {
// //
// Placeholders for non-migrated codes // Placeholders for non-migrated codes
// //
extern void gcode_G30();
extern void gcode_G31(); extern void gcode_G31();
extern void gcode_G32(); extern void gcode_G32();
extern void gcode_G38(bool is_38_2); extern void gcode_G38(bool is_38_2);
@ -362,7 +361,7 @@ void GcodeSuite::process_next_command() {
#if HAS_BED_PROBE #if HAS_BED_PROBE
case 30: // G30 Single Z probe case 30: // G30 Single Z probe
gcode_G30(); G30();
break; break;
#if ENABLED(Z_PROBE_SLED) #if ENABLED(Z_PROBE_SLED)

13
Marlin/src/gcode/probe/G30.h → Marlin/src/gcode/probe/G30.cpp

@ -20,6 +20,15 @@
* *
*/ */
#include "../../inc/MarlinConfig.h"
#if HAS_BED_PROBE
#include "../gcode.h"
#include "../../module/motion.h"
#include "../../module/probe.h"
#include "../../feature/bedlevel/bedlevel.h"
/** /**
* G30: Do a single Z probe at the current XY * G30: Do a single Z probe at the current XY
* *
@ -29,7 +38,7 @@
* Y Probe Y position (default current Y) * Y Probe Y position (default current Y)
* S0 Leave the probe deployed * S0 Leave the probe deployed
*/ */
void gcode_G30() { void GcodeSuite::G30() {
const float xpos = parser.linearval('X', current_position[X_AXIS] + X_PROBE_OFFSET_FROM_EXTRUDER), const float xpos = parser.linearval('X', current_position[X_AXIS] + X_PROBE_OFFSET_FROM_EXTRUDER),
ypos = parser.linearval('Y', current_position[Y_AXIS] + Y_PROBE_OFFSET_FROM_EXTRUDER); ypos = parser.linearval('Y', current_position[Y_AXIS] + Y_PROBE_OFFSET_FROM_EXTRUDER);
@ -54,3 +63,5 @@ void gcode_G30() {
report_current_position(); report_current_position();
} }
#endif // HAS_BED_PROBE
Loading…
Cancel
Save