From a1ee1628e58cb53d945bc32e8ed5c68f3b1964ce Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 15 Sep 2017 23:18:05 -0500 Subject: [PATCH] Move G20_G21 to cpp --- Marlin/src/Marlin.cpp | 4 ---- Marlin/src/gcode/gcode.cpp | 6 ++---- Marlin/src/gcode/units/{G20_G21.h => G20_G21.cpp} | 12 ++++++++++-- 3 files changed, 12 insertions(+), 10 deletions(-) rename Marlin/src/gcode/units/{G20_G21.h => G20_G21.cpp} (77%) diff --git a/Marlin/src/Marlin.cpp b/Marlin/src/Marlin.cpp index f83935698..9c071c0a5 100644 --- a/Marlin/src/Marlin.cpp +++ b/Marlin/src/Marlin.cpp @@ -357,10 +357,6 @@ void suicide() { ***************** GCode Handlers ***************** **************************************************/ -#if ENABLED(INCH_MODE_SUPPORT) - #include "gcode/units/G20_G21.h" -#endif - #if ENABLED(NOZZLE_PARK_FEATURE) #include "gcode/feature/pause/G27.h" #endif diff --git a/Marlin/src/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp index 1577defd3..5df697a76 100644 --- a/Marlin/src/gcode/gcode.cpp +++ b/Marlin/src/gcode/gcode.cpp @@ -116,8 +116,6 @@ void GcodeSuite::dwell(millis_t time) { // // Placeholders for non-migrated codes // -extern void gcode_G20(); -extern void gcode_G21(); extern void gcode_G27(); extern void gcode_G30(); extern void gcode_G31(); @@ -331,11 +329,11 @@ void GcodeSuite::process_next_command() { #if ENABLED(INCH_MODE_SUPPORT) case 20: // G20: Inch Mode - gcode_G20(); + G20(); break; case 21: // G21: MM Mode - gcode_G21(); + G21(); break; #endif // INCH_MODE_SUPPORT diff --git a/Marlin/src/gcode/units/G20_G21.h b/Marlin/src/gcode/units/G20_G21.cpp similarity index 77% rename from Marlin/src/gcode/units/G20_G21.h rename to Marlin/src/gcode/units/G20_G21.cpp index 6f57f04d2..74ff343af 100644 --- a/Marlin/src/gcode/units/G20_G21.h +++ b/Marlin/src/gcode/units/G20_G21.cpp @@ -20,12 +20,20 @@ * */ +#include "../../inc/MarlinConfig.h" + +#if ENABLED(INCH_MODE_SUPPORT) + +#include "../gcode.h" + /** * G20: Set input mode to inches */ -void gcode_G20() { parser.set_input_linear_units(LINEARUNIT_INCH); } +void GcodeSuite::G20() { parser.set_input_linear_units(LINEARUNIT_INCH); } /** * G21: Set input mode to millimeters */ -void gcode_G21() { parser.set_input_linear_units(LINEARUNIT_MM); } +void GcodeSuite::G21() { parser.set_input_linear_units(LINEARUNIT_MM); } + +#endif // INCH_MODE_SUPPORT