From beb346e49f1acbf3b74b5fde8bb9cb7ad080e58b Mon Sep 17 00:00:00 2001
From: Scott Lahteine <github@thinkyhead.com>
Date: Sun, 17 Sep 2017 00:28:10 -0500
Subject: [PATCH] Move M92 to cpp

---
 Marlin/src/Marlin.cpp                      | 2 --
 Marlin/src/gcode/config/{M92.h => M92.cpp} | 5 ++++-
 Marlin/src/gcode/gcode.cpp                 | 6 ++----
 3 files changed, 6 insertions(+), 7 deletions(-)
 rename Marlin/src/gcode/config/{M92.h => M92.cpp} (95%)

diff --git a/Marlin/src/Marlin.cpp b/Marlin/src/Marlin.cpp
index b3da3af431..49968cfb43 100644
--- a/Marlin/src/Marlin.cpp
+++ b/Marlin/src/Marlin.cpp
@@ -359,8 +359,6 @@ bool pin_is_protected(const int8_t pin) {
   return false;
 }
 
-#include "gcode/config/M92.h"
-
 #if ENABLED(M100_FREE_MEMORY_WATCHER)
   #include "gcode/calibrate/M100.h"
 #endif
diff --git a/Marlin/src/gcode/config/M92.h b/Marlin/src/gcode/config/M92.cpp
similarity index 95%
rename from Marlin/src/gcode/config/M92.h
rename to Marlin/src/gcode/config/M92.cpp
index 626ce68dd8..25c79fe0b8 100644
--- a/Marlin/src/gcode/config/M92.h
+++ b/Marlin/src/gcode/config/M92.cpp
@@ -20,13 +20,16 @@
  *
  */
 
+#include "../gcode.h"
+#include "../../module/planner.h"
+
 /**
  * M92: Set axis steps-per-unit for one or more axes, X, Y, Z, and E.
  *      (Follows the same syntax as G92)
  *
  *      With multiple extruders use T to specify which one.
  */
-void gcode_M92() {
+void GcodeSuite::M92() {
 
   GET_TARGET_EXTRUDER();
 
diff --git a/Marlin/src/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp
index 30c39dfabf..8c98f70b39 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_M92();
 extern void gcode_M100();
 extern void gcode_M114();
 extern void gcode_M115();
@@ -498,9 +497,8 @@ void GcodeSuite::process_next_command() {
       case 84: M18_M84(); break;  // M84: Disable all steppers or set timeout
       case 85: M85(); break;      // M85: Set inactivity stepper shutdown timeout
 
-      case 92: // M92: Set the steps-per-unit for one or more axes
-        gcode_M92();
-        break;
+      case 92: M92(); break;      // M92: Set the steps-per-unit for one or more axes
+
       case 114: // M114: Report current position
         gcode_M114();
         break;
-- 
GitLab