Browse Source

Move G2_G3 to cpp

Scott Lahteine 7 years ago
parent
commit
4007cbfe9e
3 changed files with 14 additions and 6 deletions
  1. 1
    2
      Marlin/src/gcode/gcode.cpp
  2. 1
    1
      Marlin/src/gcode/gcode.h
  3. 12
    3
      Marlin/src/gcode/motion/G2_G3.cpp

+ 1
- 2
Marlin/src/gcode/gcode.cpp View File

@@ -112,7 +112,6 @@ void GcodeSuite::dwell(millis_t time) {
112 112
 //
113 113
 // Placeholders for non-migrated codes
114 114
 //
115
-extern void gcode_G2_G3(bool clockwise);
116 115
 extern void gcode_G4();
117 116
 extern void gcode_G5();
118 117
 extern void gcode_G12();
@@ -290,7 +289,7 @@ void GcodeSuite::process_next_command() {
290 289
       #if ENABLED(ARC_SUPPORT) && DISABLED(SCARA)
291 290
         case 2: // G2: CW ARC
292 291
         case 3: // G3: CCW ARC
293
-          gcode_G2_G3(parser.codenum == 2);
292
+          G2_G3(parser.codenum == 2);
294 293
           break;
295 294
       #endif
296 295
 

+ 1
- 1
Marlin/src/gcode/gcode.h View File

@@ -310,7 +310,7 @@ private:
310 310
   );
311 311
 
312 312
   #if ENABLED(ARC_SUPPORT)
313
-    static void G2_G3(bool clockwise);
313
+    static void G2_G3(const bool clockwise);
314 314
   #endif
315 315
 
316 316
   static void G4();

Marlin/src/gcode/motion/G2_G3.h → Marlin/src/gcode/motion/G2_G3.cpp View File

@@ -20,7 +20,14 @@
20 20
  *
21 21
  */
22 22
 
23
+#include "../../inc/MarlinConfig.h"
24
+
25
+#if ENABLED(ARC_SUPPORT)
26
+
23 27
 #include "../gcode.h"
28
+#include "../../module/motion.h"
29
+#include "../../module/planner.h"
30
+#include "../../module/temperature.h"
24 31
 
25 32
 #if N_ARC_CORRECTION < 1
26 33
   #undef N_ARC_CORRECTION
@@ -203,7 +210,7 @@ void plan_arc(
203 210
  *    G2 I10           ; CW circle centered at X+10
204 211
  *    G3 X20 Y12 R14   ; CCW circle with r=14 ending at X20 Y12
205 212
  */
206
-void gcode_G2_G3(bool clockwise) {
213
+void GcodeSuite::G2_G3(const bool clockwise) {
207 214
   if (IsRunning()) {
208 215
 
209 216
     #if ENABLED(SF_ARC_FIX)
@@ -211,7 +218,7 @@ void gcode_G2_G3(bool clockwise) {
211 218
       relative_mode = true;
212 219
     #endif
213 220
 
214
-    gcode.get_destination_from_command();
221
+    get_destination_from_command();
215 222
 
216 223
     #if ENABLED(SF_ARC_FIX)
217 224
       relative_mode = relative_mode_backup;
@@ -254,7 +261,7 @@ void gcode_G2_G3(bool clockwise) {
254 261
 
255 262
       // Send the arc to the planner
256 263
       plan_arc(destination, arc_offset, clockwise);
257
-      gcode.refresh_cmd_timeout();
264
+      refresh_cmd_timeout();
258 265
     }
259 266
     else {
260 267
       // Bad arguments
@@ -263,3 +270,5 @@ void gcode_G2_G3(bool clockwise) {
263 270
     }
264 271
   }
265 272
 }
273
+
274
+#endif // ARC_SUPPORT

Loading…
Cancel
Save