From 81b8fbf4d6c5336bbb1fb4c686522fbaa145e5a2 Mon Sep 17 00:00:00 2001
From: Scott Lahteine <github@thinkyhead.com>
Date: Sun, 17 Sep 2017 00:36:30 -0500
Subject: [PATCH] Move M114 to cpp

---
 Marlin/src/Marlin.cpp                      | 1 -
 Marlin/src/gcode/gcode.cpp                 | 5 +----
 Marlin/src/gcode/host/{M114.h => M114.cpp} | 8 +++++++-
 3 files changed, 8 insertions(+), 6 deletions(-)
 rename Marlin/src/gcode/host/{M114.h => M114.cpp} (95%)

diff --git a/Marlin/src/Marlin.cpp b/Marlin/src/Marlin.cpp
index 5ba526de85..afbd07b369 100644
--- a/Marlin/src/Marlin.cpp
+++ b/Marlin/src/Marlin.cpp
@@ -355,7 +355,6 @@ bool pin_is_protected(const int8_t pin) {
   return false;
 }
 
-#include "gcode/host/M114.h"
 #include "gcode/host/M115.h"
 
 #include "gcode/lcd/M117.h"
diff --git a/Marlin/src/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp
index 7e2a08b2bf..f378679005 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_M114();
 extern void gcode_M115();
 extern void gcode_M117();
 extern void gcode_M118();
@@ -496,9 +495,7 @@ void GcodeSuite::process_next_command() {
 
       case 92: M92(); break;      // M92: Set the steps-per-unit for one or more axes
 
-      case 114: // M114: Report current position
-        gcode_M114();
-        break;
+      case 114: M114(); break;    // M114: Report current position
       case 115: // M115: Report capabilities
         gcode_M115();
         break;
diff --git a/Marlin/src/gcode/host/M114.h b/Marlin/src/gcode/host/M114.cpp
similarity index 95%
rename from Marlin/src/gcode/host/M114.h
rename to Marlin/src/gcode/host/M114.cpp
index e0ed295cc6..6ce3272a36 100644
--- a/Marlin/src/gcode/host/M114.h
+++ b/Marlin/src/gcode/host/M114.cpp
@@ -20,6 +20,12 @@
  *
  */
 
+#include "../../inc/MarlinConfig.h"
+
+#include "../gcode.h"
+#include "../../module/motion.h"
+#include "../../module/stepper.h"
+
 #ifdef M114_DETAIL
 
   void report_xyze(const float pos[XYZE], const uint8_t n = 4, const uint8_t precision = 3) {
@@ -99,7 +105,7 @@
 /**
  * M114: Report current position to host
  */
-void gcode_M114() {
+void GcodeSuite::M114() {
 
   #ifdef M114_DETAIL
     if (parser.seen('D')) {