From 0e319104c2d93ddd4c4d4be5816695b7e00e3344 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 17 Sep 2017 02:39:44 -0500 Subject: [PATCH] Move M220 to cpp --- Marlin/src/Marlin.cpp | 2 -- Marlin/src/gcode/config/{M220.h => M220.cpp} | 10 ++++++++-- Marlin/src/gcode/gcode.cpp | 5 +---- 3 files changed, 9 insertions(+), 8 deletions(-) rename Marlin/src/gcode/config/{M220.h => M220.cpp} (85%) diff --git a/Marlin/src/Marlin.cpp b/Marlin/src/Marlin.cpp index f9f94dccc..c1073d495 100644 --- a/Marlin/src/Marlin.cpp +++ b/Marlin/src/Marlin.cpp @@ -355,8 +355,6 @@ bool pin_is_protected(const int8_t pin) { return false; } -#include "gcode/config/M220.h" - #include "gcode/control/M226.h" #if ENABLED(EXPERIMENTAL_I2CBUS) diff --git a/Marlin/src/gcode/config/M220.h b/Marlin/src/gcode/config/M220.cpp similarity index 85% rename from Marlin/src/gcode/config/M220.h rename to Marlin/src/gcode/config/M220.cpp index 9d90f43d8..82fa9c0ba 100644 --- a/Marlin/src/gcode/config/M220.h +++ b/Marlin/src/gcode/config/M220.cpp @@ -20,9 +20,15 @@ * */ +#include "../gcode.h" +#include "../../module/motion.h" + /** * M220: Set speed percentage factor, aka "Feed Rate" (M220 S95) */ -void gcode_M220() { - if (parser.seenval('S')) feedrate_percentage = parser.value_int(); +void GcodeSuite::M220() { + + if (parser.seenval('S')) + feedrate_percentage = parser.value_int(); + } diff --git a/Marlin/src/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp index e037f6bf1..71557f7fd 100644 --- a/Marlin/src/gcode/gcode.cpp +++ b/Marlin/src/gcode/gcode.cpp @@ -119,7 +119,6 @@ void GcodeSuite::dwell(millis_t time) { extern void gcode_M163(); extern void gcode_M164(); extern void gcode_M165(); -extern void gcode_M220(); extern void gcode_M226(); extern void gcode_M240(); extern void gcode_M250(); @@ -559,9 +558,7 @@ void GcodeSuite::process_next_command() { break; #endif - case 220: // M220: Set Feedrate Percentage: S ("FR" on your LCD) - gcode_M220(); - break; + case 220: M220(); break; // M220: Set Feedrate Percentage: S ("FR" on your LCD) case 221: // M221: Set Flow Percentage M221();