Move G38 to cpp

This commit is contained in:
Scott Lahteine 2017-09-15 23:44:29 -05:00
parent b8adae0785
commit 84ddae56a8
4 changed files with 15 additions and 9 deletions

View File

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

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_G38(bool is_38_2);
extern void gcode_G42(); extern void gcode_G42();
extern void gcode_G92(); extern void gcode_G92();
extern void gcode_M0_M1(); extern void gcode_M0_M1();
@ -385,7 +384,7 @@ void GcodeSuite::process_next_command() {
#if ENABLED(G38_PROBE_TARGET) #if ENABLED(G38_PROBE_TARGET)
case 38: // G38.2 & G38.3 case 38: // G38.2 & G38.3
if (parser.subcode == 2 || parser.subcode == 3) if (parser.subcode == 2 || parser.subcode == 3)
gcode_G38(parser.subcode == 2); G38(parser.subcode == 2);
break; break;
#endif #endif

View File

@ -375,7 +375,7 @@ private:
#endif #endif
#if ENABLED(G38_PROBE_TARGET) #if ENABLED(G38_PROBE_TARGET)
static void G38(bool is_38_2); static void G38(const bool is_38_2);
#endif #endif
#if HAS_MESH #if HAS_MESH

View File

@ -20,8 +20,17 @@
* *
*/ */
#include "../../inc/MarlinConfig.h"
#if ENABLED(G38_PROBE_TARGET)
#include "../gcode.h" #include "../gcode.h"
#include "../../module/endstops.h"
#include "../../module/motion.h"
#include "../../module/stepper.h"
#include "../../module/probe.h"
static bool G38_run_probe() { static bool G38_run_probe() {
bool G38_pass_fail = false; bool G38_pass_fail = false;
@ -88,9 +97,9 @@ static bool G38_run_probe() {
* *
* Like G28 except uses Z min probe for all axes * Like G28 except uses Z min probe for all axes
*/ */
void gcode_G38(bool is_38_2) { void GcodeSuite::G38(const bool is_38_2) {
// Get X Y Z E F // Get X Y Z E F
gcode.get_destination_from_command(); get_destination_from_command();
setup_for_endstop_or_probe_move(); setup_for_endstop_or_probe_move();
@ -108,3 +117,5 @@ void gcode_G38(bool is_38_2) {
clean_up_after_endstop_or_probe_move(); clean_up_after_endstop_or_probe_move();
} }
#endif // G38_PROBE_TARGET