From fc52fc72ac4ff1b2a66a0189a45745f36c2bf23e Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 16 Sep 2017 04:13:55 -0500 Subject: [PATCH] Move M48 to cpp --- Marlin/src/Marlin.cpp | 4 ---- Marlin/src/gcode/calibrate/{M48.h => M48.cpp} | 16 +++++++++++++++- Marlin/src/gcode/gcode.cpp | 7 ++----- 3 files changed, 17 insertions(+), 10 deletions(-) rename Marlin/src/gcode/calibrate/{M48.h => M48.cpp} (96%) diff --git a/Marlin/src/Marlin.cpp b/Marlin/src/Marlin.cpp index 5dc6866a1..4437f9f2b 100644 --- a/Marlin/src/Marlin.cpp +++ b/Marlin/src/Marlin.cpp @@ -370,10 +370,6 @@ bool pin_is_protected(const int8_t pin) { return false; } -#if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST) - #include "gcode/calibrate/M48.h" -#endif - #include "gcode/stats/M75.h" #include "gcode/stats/M76.h" #include "gcode/stats/M77.h" diff --git a/Marlin/src/gcode/calibrate/M48.h b/Marlin/src/gcode/calibrate/M48.cpp similarity index 96% rename from Marlin/src/gcode/calibrate/M48.h rename to Marlin/src/gcode/calibrate/M48.cpp index 4ad990d75..4c32933b0 100644 --- a/Marlin/src/gcode/calibrate/M48.h +++ b/Marlin/src/gcode/calibrate/M48.cpp @@ -20,6 +20,18 @@ * */ +#include "../../inc/MarlinConfig.h" + +#if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST) + +#include "../gcode.h" +#include "../../module/motion.h" +#include "../../module/probe.h" + +#if DISABLED(DELTA) + #include "../../feature/bedlevel/bedlevel.h" +#endif + /** * M48: Z probe repeatability measurement function. * @@ -38,7 +50,7 @@ * Any information generated by a prior G29 Bed leveling command will be lost and need to be * regenerated. */ -void gcode_M48() { +void GcodeSuite::M48() { if (axis_unhomed_error()) return; @@ -271,3 +283,5 @@ void gcode_M48() { report_current_position(); } + +#endif // Z_MIN_PROBE_REPEATABILITY_TEST diff --git a/Marlin/src/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp index ca69bcbed..c30b21a66 100644 --- a/Marlin/src/gcode/gcode.cpp +++ b/Marlin/src/gcode/gcode.cpp @@ -117,7 +117,6 @@ void GcodeSuite::dwell(millis_t time) { // Placeholders for non-migrated codes // extern void gcode_M18_M84(); -extern void gcode_M48(); extern void gcode_M75(); extern void gcode_M76(); extern void gcode_M77(); @@ -438,10 +437,8 @@ void GcodeSuite::process_next_command() { #endif #if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST) - case 48: // M48: Z probe repeatability test - gcode_M48(); - break; - #endif // Z_MIN_PROBE_REPEATABILITY_TEST + case 48: M48(); break; // M48: Z probe repeatability test + #endif #if ENABLED(UBL_G26_MESH_VALIDATION) case 49: M49(); break; // M49: Turn on or off G26 debug flag for verbose output