From 4007cbfe9e1316b23e594281f520ac49e36f2561 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 15 Sep 2017 20:57:52 -0500 Subject: [PATCH] Move G2_G3 to cpp --- Marlin/src/gcode/gcode.cpp | 3 +-- Marlin/src/gcode/gcode.h | 2 +- Marlin/src/gcode/motion/{G2_G3.h => G2_G3.cpp} | 15 ++++++++++++--- 3 files changed, 14 insertions(+), 6 deletions(-) rename Marlin/src/gcode/motion/{G2_G3.h => G2_G3.cpp} (97%) diff --git a/Marlin/src/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp index 89bc70946..a8c05c214 100644 --- a/Marlin/src/gcode/gcode.cpp +++ b/Marlin/src/gcode/gcode.cpp @@ -112,7 +112,6 @@ void GcodeSuite::dwell(millis_t time) { // // Placeholders for non-migrated codes // -extern void gcode_G2_G3(bool clockwise); extern void gcode_G4(); extern void gcode_G5(); extern void gcode_G12(); @@ -290,7 +289,7 @@ void GcodeSuite::process_next_command() { #if ENABLED(ARC_SUPPORT) && DISABLED(SCARA) case 2: // G2: CW ARC case 3: // G3: CCW ARC - gcode_G2_G3(parser.codenum == 2); + G2_G3(parser.codenum == 2); break; #endif diff --git a/Marlin/src/gcode/gcode.h b/Marlin/src/gcode/gcode.h index dd44e42a8..68d8f1e50 100644 --- a/Marlin/src/gcode/gcode.h +++ b/Marlin/src/gcode/gcode.h @@ -310,7 +310,7 @@ private: ); #if ENABLED(ARC_SUPPORT) - static void G2_G3(bool clockwise); + static void G2_G3(const bool clockwise); #endif static void G4(); diff --git a/Marlin/src/gcode/motion/G2_G3.h b/Marlin/src/gcode/motion/G2_G3.cpp similarity index 97% rename from Marlin/src/gcode/motion/G2_G3.h rename to Marlin/src/gcode/motion/G2_G3.cpp index 90fadd968..2986a86a6 100644 --- a/Marlin/src/gcode/motion/G2_G3.h +++ b/Marlin/src/gcode/motion/G2_G3.cpp @@ -20,7 +20,14 @@ * */ +#include "../../inc/MarlinConfig.h" + +#if ENABLED(ARC_SUPPORT) + #include "../gcode.h" +#include "../../module/motion.h" +#include "../../module/planner.h" +#include "../../module/temperature.h" #if N_ARC_CORRECTION < 1 #undef N_ARC_CORRECTION @@ -203,7 +210,7 @@ void plan_arc( * G2 I10 ; CW circle centered at X+10 * G3 X20 Y12 R14 ; CCW circle with r=14 ending at X20 Y12 */ -void gcode_G2_G3(bool clockwise) { +void GcodeSuite::G2_G3(const bool clockwise) { if (IsRunning()) { #if ENABLED(SF_ARC_FIX) @@ -211,7 +218,7 @@ void gcode_G2_G3(bool clockwise) { relative_mode = true; #endif - gcode.get_destination_from_command(); + get_destination_from_command(); #if ENABLED(SF_ARC_FIX) relative_mode = relative_mode_backup; @@ -254,7 +261,7 @@ void gcode_G2_G3(bool clockwise) { // Send the arc to the planner plan_arc(destination, arc_offset, clockwise); - gcode.refresh_cmd_timeout(); + refresh_cmd_timeout(); } else { // Bad arguments @@ -263,3 +270,5 @@ void gcode_G2_G3(bool clockwise) { } } } + +#endif // ARC_SUPPORT