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,15 +20,18 @@
*
*/
#include "../gcode.h"
#include "../../Marlin.h"
/**
* M200: Set filament diameter and set E axis units to cubic units
*
* T<extruder> - Optional extruder number. Current extruder if omitted.
* D<linear> - Diameter of the filament. Use "D0" to switch back to linear units on the E axis.
*/
void gcode_M200() {
void GcodeSuite::M200() {
if (get_target_extruder_from_command(200)) return;
if (get_target_extruder_from_command()) return;
if (parser.seen('D')) {
// setting any extruder filament size disables volumetric on the assumption that

View File

@ -27,7 +27,7 @@
*/
void gcode_M201() {
GET_TARGET_EXTRUDER(201);
GET_TARGET_EXTRUDER();
LOOP_XYZE(i) {
if (parser.seen(axis_codes[i])) {

View File

@ -27,7 +27,7 @@
*/
void gcode_M203() {
GET_TARGET_EXTRUDER(203);
GET_TARGET_EXTRUDER();
LOOP_XYZE(i)
if (parser.seen(axis_codes[i])) {

View File

@ -20,6 +20,13 @@
*
*/
#include "../../inc/MarlinConfig.h"
#if HOTENDS > 1
#include "../gcode.h"
#include "../../module/motion.h"
/**
* M218 - set hotend offset (in linear units)
*
@ -28,8 +35,8 @@
* Y<yoffset>
* Z<zoffset> - Available with DUAL_X_CARRIAGE and SWITCHING_NOZZLE
*/
void gcode_M218() {
if (get_target_extruder_from_command(218) || target_extruder == 0) return;
void GcodeSuite::M218() {
if (get_target_extruder_from_command() || target_extruder == 0) return;
if (parser.seenval('X')) hotend_offset[X_AXIS][target_extruder] = parser.value_linear_units();
if (parser.seenval('Y')) hotend_offset[Y_AXIS][target_extruder] = parser.value_linear_units();
@ -52,3 +59,5 @@ void gcode_M218() {
}
SERIAL_EOL();
}
#endif // HOTENDS > 1

View File

@ -20,11 +20,14 @@
*
*/
#include "../gcode.h"
#include "../../Marlin.h"
/**
* M221: Set extrusion percentage (M221 T0 S95)
*/
void gcode_M221() {
if (get_target_extruder_from_command(221)) return;
void GcodeSuite::M221() {
if (get_target_extruder_from_command()) return;
if (parser.seenval('S'))
flow_percentage[target_extruder] = parser.value_int();
}

View File

@ -20,6 +20,8 @@
*
*/
#include "../gcode.h"
#include "../../pins/pinsDebug.h"
inline void toggle_pins() {
@ -141,7 +143,7 @@ inline void servo_probe_test() {
}
if (probe_inverting != deploy_state) SERIAL_PROTOCOLLNPGM("WARNING - INVERTING setting probably backwards");
refresh_cmd_timeout();
gcode.refresh_cmd_timeout();
if (deploy_state != stow_state) {
SERIAL_PROTOCOLLNPGM("BLTouch clone detected");
@ -170,7 +172,7 @@ inline void servo_probe_test() {
safe_delay(2);
if (0 == j % (500 * 1)) // keep cmd_timeout happy
refresh_cmd_timeout();
gcode.refresh_cmd_timeout();
if (deploy_state != READ(PROBE_TEST_PIN)) { // probe triggered

View File

@ -28,7 +28,7 @@
*/
void gcode_M92() {
GET_TARGET_EXTRUDER(92);
GET_TARGET_EXTRUDER();
LOOP_XYZE(i) {
if (parser.seen(axis_codes[i])) {