Add gcode.cpp, motion.*, queue.* - Apply to some G-codes.

This commit is contained in:
Scott Lahteine
2017-09-07 22:33:16 -05:00
parent 4231faf779
commit 722786966a
42 changed files with 1898 additions and 1370 deletions

View File

@ -20,16 +20,25 @@
*
*/
#include "../gcode.h"
#include "../../module/motion.h"
#include "../../Marlin.h"
#include "../../sd/cardreader.h"
extern float destination[XYZE];
/**
* G0, G1: Coordinated movement of X Y Z E axes
*/
void gcode_G0_G1(
void GcodeSuite::G0_G1(
#if IS_SCARA
bool fast_move=false
bool fast_move/*=false*/
#endif
) {
if (IsRunning()) {
gcode_get_destination(); // For X Y Z E F
get_destination_from_command(); // For X Y Z E F
#if ENABLED(FWRETRACT)
if (MIN_AUTORETRACT <= MAX_AUTORETRACT) {

View File

@ -20,6 +20,8 @@
*
*/
#include "../gcode.h"
#if N_ARC_CORRECTION < 1
#undef N_ARC_CORRECTION
#define N_ARC_CORRECTION 1
@ -209,7 +211,7 @@ void gcode_G2_G3(bool clockwise) {
relative_mode = true;
#endif
gcode_get_destination();
gcode.get_destination_from_command();
#if ENABLED(SF_ARC_FIX)
relative_mode = relative_mode_backup;
@ -252,7 +254,7 @@ void gcode_G2_G3(bool clockwise) {
// Send the arc to the planner
plan_arc(destination, arc_offset, clockwise);
refresh_cmd_timeout();
gcode.refresh_cmd_timeout();
}
else {
// Bad arguments

View File

@ -21,6 +21,7 @@
*/
#include "../../module/planner_bezier.h"
#include "../../gcode/gcode.h"
void plan_cubic_move(const float offset[4]) {
cubic_b_spline(current_position, destination, offset, MMS_SCALED(feedrate_mm_s), active_extruder);
@ -52,7 +53,7 @@ void gcode_G5() {
}
#endif
gcode_get_destination();
gcode.get_destination_from_command();
const float offset[] = {
parser.linearval('I'),