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
 //
112
 //
113
 // Placeholders for non-migrated codes
113
 // Placeholders for non-migrated codes
114
 //
114
 //
115
-extern void gcode_G2_G3(bool clockwise);
116
 extern void gcode_G4();
115
 extern void gcode_G4();
117
 extern void gcode_G5();
116
 extern void gcode_G5();
118
 extern void gcode_G12();
117
 extern void gcode_G12();
290
       #if ENABLED(ARC_SUPPORT) && DISABLED(SCARA)
289
       #if ENABLED(ARC_SUPPORT) && DISABLED(SCARA)
291
         case 2: // G2: CW ARC
290
         case 2: // G2: CW ARC
292
         case 3: // G3: CCW ARC
291
         case 3: // G3: CCW ARC
293
-          gcode_G2_G3(parser.codenum == 2);
292
+          G2_G3(parser.codenum == 2);
294
           break;
293
           break;
295
       #endif
294
       #endif
296
 
295
 

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

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

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

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

Loading…
Cancel
Save