diff --git a/Marlin/src/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp
index 89bc70946ab92368e9db07bd8773803061f528d4..a8c05c21419807c80461febc64ab024fbb995ec8 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 dd44e42a85b25792b6fb7d9a122f01c57290ab38..68d8f1e50603d0ff5354655a2a3a662c2214dc68 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 90fadd968ff30e27a3291ba4f6f46e92307f030c..2986a86a65aed426c411580f691b0814157c5d35 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