1
0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2024-11-30 23:30:16 +00:00

Move G2_G3 to cpp

This commit is contained in:
Scott Lahteine 2017-09-15 20:57:52 -05:00
parent 27f7e3fe6f
commit 4007cbfe9e
3 changed files with 14 additions and 6 deletions

View File

@ -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

View File

@ -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();

View File

@ -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