Browse Source

Move G2_G3 to cpp

pull/1/head
Scott Lahteine 7 years ago
parent
commit
4007cbfe9e
  1. 3
      Marlin/src/gcode/gcode.cpp
  2. 2
      Marlin/src/gcode/gcode.h
  3. 15
      Marlin/src/gcode/motion/G2_G3.cpp

3
Marlin/src/gcode/gcode.cpp

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

2
Marlin/src/gcode/gcode.h

@ -310,7 +310,7 @@ private:
); );
#if ENABLED(ARC_SUPPORT) #if ENABLED(ARC_SUPPORT)
static void G2_G3(bool clockwise); static void G2_G3(const bool clockwise);
#endif #endif
static void G4(); static void G4();

15
Marlin/src/gcode/motion/G2_G3.h → Marlin/src/gcode/motion/G2_G3.cpp

@ -20,7 +20,14 @@
* *
*/ */
#include "../../inc/MarlinConfig.h"
#if ENABLED(ARC_SUPPORT)
#include "../gcode.h" #include "../gcode.h"
#include "../../module/motion.h"
#include "../../module/planner.h"
#include "../../module/temperature.h"
#if N_ARC_CORRECTION < 1 #if N_ARC_CORRECTION < 1
#undef N_ARC_CORRECTION #undef N_ARC_CORRECTION
@ -203,7 +210,7 @@ void plan_arc(
* G2 I10 ; CW circle centered at X+10 * G2 I10 ; CW circle centered at X+10
* G3 X20 Y12 R14 ; CCW circle with r=14 ending at X20 Y12 * 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 (IsRunning()) {
#if ENABLED(SF_ARC_FIX) #if ENABLED(SF_ARC_FIX)
@ -211,7 +218,7 @@ void gcode_G2_G3(bool clockwise) {
relative_mode = true; relative_mode = true;
#endif #endif
gcode.get_destination_from_command(); get_destination_from_command();
#if ENABLED(SF_ARC_FIX) #if ENABLED(SF_ARC_FIX)
relative_mode = relative_mode_backup; relative_mode = relative_mode_backup;
@ -254,7 +261,7 @@ void gcode_G2_G3(bool clockwise) {
// Send the arc to the planner // Send the arc to the planner
plan_arc(destination, arc_offset, clockwise); plan_arc(destination, arc_offset, clockwise);
gcode.refresh_cmd_timeout(); refresh_cmd_timeout();
} }
else { else {
// Bad arguments // Bad arguments
@ -263,3 +270,5 @@ void gcode_G2_G3(bool clockwise) {
} }
} }
} }
#endif // ARC_SUPPORT
Loading…
Cancel
Save