From 1b0acbff720046cdaa7d24dcbc8dbf5d26b3c1b8 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 17 Sep 2017 17:24:56 -0500 Subject: [PATCH] Move M605 to cpp --- Marlin/src/Marlin.cpp | 4 ---- Marlin/src/gcode/control/{M605.h => M605.cpp} | 14 ++++++++++++-- Marlin/src/gcode/gcode.cpp | 7 ++----- 3 files changed, 14 insertions(+), 11 deletions(-) rename Marlin/src/gcode/control/{M605.h => M605.cpp} (90%) diff --git a/Marlin/src/Marlin.cpp b/Marlin/src/Marlin.cpp index 986cf2ae68..9dcc90b75a 100644 --- a/Marlin/src/Marlin.cpp +++ b/Marlin/src/Marlin.cpp @@ -359,10 +359,6 @@ void quickstop_stepper() { SYNC_PLAN_POSITION_KINEMATIC(); } -#if ENABLED(DUAL_X_CARRIAGE) || ENABLED(DUAL_NOZZLE_DUPLICATION_MODE) - #include "gcode/control/M605.h" -#endif - #if ENABLED(LIN_ADVANCE) #include "gcode/feature/advance/M900.h" #endif diff --git a/Marlin/src/gcode/control/M605.h b/Marlin/src/gcode/control/M605.cpp similarity index 90% rename from Marlin/src/gcode/control/M605.h rename to Marlin/src/gcode/control/M605.cpp index ab423ab609..4cfa571990 100644 --- a/Marlin/src/gcode/control/M605.h +++ b/Marlin/src/gcode/control/M605.cpp @@ -20,6 +20,14 @@ * */ +#include "../../inc/MarlinConfig.h" + +#if ENABLED(DUAL_X_CARRIAGE) || ENABLED(DUAL_NOZZLE_DUPLICATION_MODE) + +#include "../gcode.h" +#include "../../module/motion.h" +#include "../../module/stepper.h" + #if ENABLED(DUAL_X_CARRIAGE) /** @@ -34,7 +42,7 @@ * * Note: the X axis should be homed after changing dual x-carriage mode. */ - void gcode_M605() { + void GcodeSuite::M605() { stepper.synchronize(); if (parser.seen('S')) dual_x_carriage_mode = (DualXMode)parser.value_byte(); switch (dual_x_carriage_mode) { @@ -66,7 +74,7 @@ #elif ENABLED(DUAL_NOZZLE_DUPLICATION_MODE) - void gcode_M605() { + void GcodeSuite::M605() { stepper.synchronize(); extruder_duplication_enabled = parser.intval('S') == (int)DXC_DUPLICATION_MODE; SERIAL_ECHO_START(); @@ -74,3 +82,5 @@ } #endif // DUAL_NOZZLE_DUPLICATION_MODE + +#endif // DUAL_X_CARRIAGE || DUAL_NOZZLE_DUPLICATION_MODE diff --git a/Marlin/src/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp index bdea78350f..f2b7017226 100644 --- a/Marlin/src/gcode/gcode.cpp +++ b/Marlin/src/gcode/gcode.cpp @@ -122,7 +122,6 @@ extern void gcode_M165(); extern void gcode_M350(); extern void gcode_M351(); extern void gcode_M355(); -extern void gcode_M605(); extern void gcode_M900(); extern void gcode_M906(); extern void gcode_M911(); @@ -651,10 +650,8 @@ void GcodeSuite::process_next_command() { #endif // ADVANCED_PAUSE_FEATURE #if ENABLED(DUAL_X_CARRIAGE) || ENABLED(DUAL_NOZZLE_DUPLICATION_MODE) - case 605: // M605: Set Dual X Carriage movement mode - gcode_M605(); - break; - #endif // DUAL_X_CARRIAGE + case 605: M605(); break; // M605: Set Dual X Carriage movement mode + #endif #if ENABLED(MK2_MULTIPLEXER) case 702: M702(); break; // M702: Unload all extruders