From f5877aa93e6a7e592a4a9b1dd6f1dfcf6803b031 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 17 Sep 2017 02:21:21 -0500 Subject: [PATCH] Move M665 to cpp --- Marlin/src/Marlin.cpp | 4 ---- Marlin/src/gcode/calibrate/{M665.h => M665.cpp} | 17 +++++++++++++++-- Marlin/src/gcode/gcode.cpp | 5 +---- 3 files changed, 16 insertions(+), 10 deletions(-) rename Marlin/src/gcode/calibrate/{M665.h => M665.cpp} (92%) diff --git a/Marlin/src/Marlin.cpp b/Marlin/src/Marlin.cpp index a3a8d3a04..b409ff090 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; } -#if IS_KINEMATIC - #include "gcode/calibrate/M665.h" -#endif - #if ENABLED(DELTA) || ENABLED(Z_DUAL_ENDSTOPS) #include "gcode/calibrate/M666.h" #endif diff --git a/Marlin/src/gcode/calibrate/M665.h b/Marlin/src/gcode/calibrate/M665.cpp similarity index 92% rename from Marlin/src/gcode/calibrate/M665.h rename to Marlin/src/gcode/calibrate/M665.cpp index da682fc12..b71420483 100644 --- a/Marlin/src/gcode/calibrate/M665.h +++ b/Marlin/src/gcode/calibrate/M665.cpp @@ -20,8 +20,17 @@ * */ +#include "../../inc/MarlinConfig.h" + +#if IS_KINEMATIC + +#include "../gcode.h" +#include "../../module/motion.h" + #if ENABLED(DELTA) + #include "../../module/delta.h" + /** * M665: Set delta configurations * @@ -34,7 +43,7 @@ * Y = Beta (Tower 2) angle trim * Z = Rotate A and B by this angle */ - void gcode_M665() { + void GcodeSuite::M665() { if (parser.seen('H')) { home_offset[Z_AXIS] = parser.value_linear_units() - DELTA_HEIGHT; update_software_endstops(Z_AXIS); @@ -54,6 +63,8 @@ #elif IS_SCARA + #include "../../module/scara.h" + /** * M665: Set SCARA settings * @@ -66,7 +77,7 @@ * A, P, and X are all aliases for the shoulder angle * B, T, and Y are all aliases for the elbow angle */ - void gcode_M665() { + void GcodeSuite::M665() { if (parser.seen('S')) delta_segments_per_second = parser.value_float(); const bool hasA = parser.seen('A'), hasP = parser.seen('P'), hasX = parser.seen('X'); @@ -91,3 +102,5 @@ } #endif + +#endif // IS_KINEMATIC diff --git a/Marlin/src/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp index a5da9ce62..3546a706e 100644 --- a/Marlin/src/gcode/gcode.cpp +++ b/Marlin/src/gcode/gcode.cpp @@ -151,7 +151,6 @@ extern void gcode_M502(); extern void gcode_M503(); extern void gcode_M540(); extern void gcode_M605(); -extern void gcode_M665(); extern void gcode_M666(); extern void gcode_M702(); extern void gcode_M900(); @@ -541,9 +540,7 @@ void GcodeSuite::process_next_command() { #endif #if ENABLED(DELTA) - case 665: // M665: Set delta configurations - gcode_M665(); - break; + case 665: M665(); break; // M665: Set delta configurations #endif #if ENABLED(DELTA) || ENABLED(Z_DUAL_ENDSTOPS)