From 13136376ee6e39c4fdc393b32b71dfcf61807faf Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 15 Sep 2017 23:22:58 -0500 Subject: [PATCH] Move G27 to cpp --- Marlin/src/Marlin.cpp | 4 ---- Marlin/src/gcode/feature/pause/{G27.h => G27.cpp} | 13 ++++++++++++- Marlin/src/gcode/gcode.cpp | 3 +-- 3 files changed, 13 insertions(+), 7 deletions(-) rename Marlin/src/gcode/feature/pause/{G27.h => G27.cpp} (81%) diff --git a/Marlin/src/Marlin.cpp b/Marlin/src/Marlin.cpp index 9c071c0a5..e2fded4ad 100644 --- a/Marlin/src/Marlin.cpp +++ b/Marlin/src/Marlin.cpp @@ -357,10 +357,6 @@ void suicide() { ***************** GCode Handlers ***************** **************************************************/ -#if ENABLED(NOZZLE_PARK_FEATURE) - #include "gcode/feature/pause/G27.h" -#endif - #if HAS_BED_PROBE #include "gcode/probe/G30.h" #if ENABLED(Z_PROBE_SLED) diff --git a/Marlin/src/gcode/feature/pause/G27.h b/Marlin/src/gcode/feature/pause/G27.cpp similarity index 81% rename from Marlin/src/gcode/feature/pause/G27.h rename to Marlin/src/gcode/feature/pause/G27.cpp index 2c6144982..b7e77928a 100644 --- a/Marlin/src/gcode/feature/pause/G27.h +++ b/Marlin/src/gcode/feature/pause/G27.cpp @@ -20,11 +20,22 @@ * */ + +#include "../../../inc/MarlinConfig.h" + +#if ENABLED(NOZZLE_PARK_FEATURE) + +#include "../../gcode.h" +#include "../../../libs/nozzle.h" +#include "../../../module/motion.h" + /** * G27: Park the nozzle */ -void gcode_G27() { +void GcodeSuite::G27() { // Don't allow nozzle parking without homing first if (axis_unhomed_error()) return; Nozzle::park(parser.ushortval('P')); } + +#endif // NOZZLE_PARK_FEATURE diff --git a/Marlin/src/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp index 5df697a76..43776191b 100644 --- a/Marlin/src/gcode/gcode.cpp +++ b/Marlin/src/gcode/gcode.cpp @@ -116,7 +116,6 @@ void GcodeSuite::dwell(millis_t time) { // // Placeholders for non-migrated codes // -extern void gcode_G27(); extern void gcode_G30(); extern void gcode_G31(); extern void gcode_G32(); @@ -345,7 +344,7 @@ void GcodeSuite::process_next_command() { #if ENABLED(NOZZLE_PARK_FEATURE) case 27: // G27: Nozzle Park - gcode_G27(); + G27(); break; #endif // NOZZLE_PARK_FEATURE