diff --git a/Marlin/src/Marlin.cpp b/Marlin/src/Marlin.cpp index cef241e538..9d2772f50e 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/config/M203.h" -#include "gcode/config/M204.h" -#include "gcode/config/M205.h" - #if HAS_M206_COMMAND #include "gcode/geometry/M206.h" #endif diff --git a/Marlin/src/gcode/config/M203.h b/Marlin/src/gcode/config/M203.cpp similarity index 93% rename from Marlin/src/gcode/config/M203.h rename to Marlin/src/gcode/config/M203.cpp index bde9b7a861..60f9ce37be 100644 --- a/Marlin/src/gcode/config/M203.h +++ b/Marlin/src/gcode/config/M203.cpp @@ -20,12 +20,15 @@ * */ +#include "../gcode.h" +#include "../../module/planner.h" + /** * M203: Set maximum feedrate that your machine can sustain (M203 X200 Y200 Z300 E10000) in units/sec * * With multiple extruders use T to specify which one. */ -void gcode_M203() { +void GcodeSuite::M203() { GET_TARGET_EXTRUDER(); diff --git a/Marlin/src/gcode/config/M204.h b/Marlin/src/gcode/config/M204.cpp similarity index 95% rename from Marlin/src/gcode/config/M204.h rename to Marlin/src/gcode/config/M204.cpp index 22d88f1d64..c8edcbf971 100644 --- a/Marlin/src/gcode/config/M204.h +++ b/Marlin/src/gcode/config/M204.cpp @@ -20,6 +20,9 @@ * */ +#include "../gcode.h" +#include "../../module/planner.h" + /** * M204: Set Accelerations in units/sec^2 (M204 P1200 R3000 T3000) * @@ -29,7 +32,7 @@ * * Also sets minimum segment time in ms (B20000) to prevent buffer under-runs and M20 minimum feedrate */ -void gcode_M204() { +void GcodeSuite::M204() { if (parser.seen('S')) { // Kept for legacy compatibility. Should NOT BE USED for new developments. planner.travel_acceleration = planner.acceleration = parser.value_linear_units(); SERIAL_ECHOLNPAIR("Setting Print and Travel Acceleration: ", planner.acceleration); diff --git a/Marlin/src/gcode/config/M205.h b/Marlin/src/gcode/config/M205.cpp similarity index 95% rename from Marlin/src/gcode/config/M205.h rename to Marlin/src/gcode/config/M205.cpp index 5b0ce3b578..e6b39150d0 100644 --- a/Marlin/src/gcode/config/M205.h +++ b/Marlin/src/gcode/config/M205.cpp @@ -20,6 +20,9 @@ * */ +#include "../gcode.h" +#include "../../module/planner.h" + /** * M205: Set Advanced Settings * @@ -31,7 +34,7 @@ * Z = Max Z Jerk (units/sec^2) * E = Max E Jerk (units/sec^2) */ -void gcode_M205() { +void GcodeSuite::M205() { if (parser.seen('S')) planner.min_feedrate_mm_s = parser.value_linear_units(); if (parser.seen('T')) planner.min_travel_feedrate_mm_s = parser.value_linear_units(); if (parser.seen('B')) planner.min_segment_time = parser.value_millis(); diff --git a/Marlin/src/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp index 0ae62b6461..1525ba2fa5 100644 --- a/Marlin/src/gcode/gcode.cpp +++ b/Marlin/src/gcode/gcode.cpp @@ -119,9 +119,6 @@ void GcodeSuite::dwell(millis_t time) { extern void gcode_M163(); extern void gcode_M164(); extern void gcode_M165(); -extern void gcode_M203(); -extern void gcode_M204(); -extern void gcode_M205(); extern void gcode_M206(); extern void gcode_M211(); extern void gcode_M220(); @@ -536,15 +533,9 @@ void GcodeSuite::process_next_command() { case 202: M202(); break; // Not used for Sprinter/grbl gen6 #endif - case 203: // M203: Set max feedrate (units/sec) - gcode_M203(); - break; - case 204: // M204: Set acceleration - gcode_M204(); - break; - case 205: // M205: Set advanced settings - gcode_M205(); - break; + case 203: M203(); break; // M203: Set max feedrate (units/sec) + case 204: M204(); break; // M204: Set acceleration + case 205: M205(); break; // M205: Set advanced settings #if HAS_M206_COMMAND case 206: // M206: Set home offsets