Move G30 to cpp

This commit is contained in:
Scott Lahteine 2017-09-15 23:27:30 -05:00
parent 13136376ee
commit 9db5d21837
3 changed files with 15 additions and 8 deletions

View file

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

View file

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

View file

@ -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
*
@ -29,7 +38,7 @@
* Y Probe Y position (default current Y)
* 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),
ypos = parser.linearval('Y', current_position[Y_AXIS] + Y_PROBE_OFFSET_FROM_EXTRUDER);
@ -54,3 +63,5 @@ void gcode_G30() {
report_current_position();
}
#endif // HAS_BED_PROBE