From eef4a5477887996e67947239add9dde2d34550e6 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 17 Sep 2017 00:46:24 -0500 Subject: [PATCH] Move M119-M121 to cpp --- Marlin/src/Marlin.cpp | 4 ---- .../gcode/control/{M120_M121.h => M120_M121.cpp} | 15 +++++---------- Marlin/src/gcode/gcode.cpp | 15 +++------------ Marlin/src/gcode/host/{M119.h => M119.cpp} | 9 ++++++++- 4 files changed, 16 insertions(+), 27 deletions(-) rename Marlin/src/gcode/control/{M120_M121.h => M120_M121.cpp} (85%) rename Marlin/src/gcode/host/{M119.h => M119.cpp} (89%) diff --git a/Marlin/src/Marlin.cpp b/Marlin/src/Marlin.cpp index e7e92242f4..988d696add 100644 --- a/Marlin/src/Marlin.cpp +++ b/Marlin/src/Marlin.cpp @@ -355,10 +355,6 @@ bool pin_is_protected(const int8_t pin) { return false; } -#include "gcode/host/M119.h" - -#include "gcode/control/M120_M121.h" - #if HAS_COLOR_LEDS #include "gcode/feature/leds/M150.h" #endif diff --git a/Marlin/src/gcode/control/M120_M121.h b/Marlin/src/gcode/control/M120_M121.cpp similarity index 85% rename from Marlin/src/gcode/control/M120_M121.h rename to Marlin/src/gcode/control/M120_M121.cpp index 4840a7a5aa..3425fc9477 100644 --- a/Marlin/src/gcode/control/M120_M121.h +++ b/Marlin/src/gcode/control/M120_M121.cpp @@ -20,20 +20,15 @@ * */ +#include "../gcode.h" +#include "../../module/endstops.h" + /** * M120: Enable endstops and set non-homing endstop state to "enabled" */ -void gcode_M120() { - - endstops.enable_globally(true); - -} +void GcodeSuite::M120() { endstops.enable_globally(true); } /** * M121: Disable endstops and set non-homing endstop state to "disabled" */ -void gcode_M121() { - - endstops.enable_globally(false); - -} +void GcodeSuite::M121() { endstops.enable_globally(false); } diff --git a/Marlin/src/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp index 3c3f1cd807..0d6e2b1552 100644 --- a/Marlin/src/gcode/gcode.cpp +++ b/Marlin/src/gcode/gcode.cpp @@ -116,9 +116,6 @@ void GcodeSuite::dwell(millis_t time) { // // Placeholders for non-migrated codes // -extern void gcode_M119(); -extern void gcode_M120(); -extern void gcode_M121(); extern void gcode_M150(); extern void gcode_M163(); extern void gcode_M164(); @@ -499,15 +496,9 @@ void GcodeSuite::process_next_command() { case 117: M117(); break; // M117: Set LCD message text, if possible case 118: M118(); break; // M118: Display a message in the host console - case 119: // M119: Report endstop states - gcode_M119(); - break; - case 120: // M120: Enable endstops - gcode_M120(); - break; - case 121: // M121: Disable endstops - gcode_M121(); - break; + case 119: M119(); break; // M119: Report endstop states + case 120: M120(); break; // M120: Enable endstops + case 121: M121(); break; // M121: Disable endstops #if ENABLED(ULTIPANEL) case 145: M145(); break; // M145: Set material heatup parameters diff --git a/Marlin/src/gcode/host/M119.h b/Marlin/src/gcode/host/M119.cpp similarity index 89% rename from Marlin/src/gcode/host/M119.h rename to Marlin/src/gcode/host/M119.cpp index 6b68ba0903..7e2399e169 100644 --- a/Marlin/src/gcode/host/M119.h +++ b/Marlin/src/gcode/host/M119.cpp @@ -20,7 +20,14 @@ * */ +#include "../gcode.h" +#include "../../module/endstops.h" + /** * M119: Output endstop states to serial output */ -void gcode_M119() { endstops.M119(); } +void GcodeSuite::M119() { + + endstops.M119(); + +}