Browse Source

M218: report with no parameters

pull/1/head
Scott Lahteine 7 years ago
parent
commit
5b45aab262
  1. 18
      Marlin/src/gcode/config/M218.cpp
  2. 2
      Marlin/src/gcode/gcode.h

18
Marlin/src/gcode/config/M218.cpp

@ -38,13 +38,24 @@
void GcodeSuite::M218() { void GcodeSuite::M218() {
if (get_target_extruder_from_command() || target_extruder == 0) return; if (get_target_extruder_from_command() || target_extruder == 0) return;
if (parser.seenval('X')) hotend_offset[X_AXIS][target_extruder] = parser.value_linear_units(); bool report = true;
if (parser.seenval('Y')) hotend_offset[Y_AXIS][target_extruder] = parser.value_linear_units(); if (parser.seenval('X')) {
hotend_offset[X_AXIS][target_extruder] = parser.value_linear_units();
report = false;
}
if (parser.seenval('Y')) {
hotend_offset[Y_AXIS][target_extruder] = parser.value_linear_units();
report = false;
}
#if ENABLED(DUAL_X_CARRIAGE) || ENABLED(SWITCHING_NOZZLE) || ENABLED(PARKING_EXTRUDER) #if ENABLED(DUAL_X_CARRIAGE) || ENABLED(SWITCHING_NOZZLE) || ENABLED(PARKING_EXTRUDER)
if (parser.seenval('Z')) hotend_offset[Z_AXIS][target_extruder] = parser.value_linear_units(); if (parser.seenval('Z')) {
hotend_offset[Z_AXIS][target_extruder] = parser.value_linear_units();
report = false;
}
#endif #endif
if (report) {
SERIAL_ECHO_START(); SERIAL_ECHO_START();
SERIAL_ECHOPGM(MSG_HOTEND_OFFSET); SERIAL_ECHOPGM(MSG_HOTEND_OFFSET);
HOTEND_LOOP() { HOTEND_LOOP() {
@ -59,5 +70,6 @@ void GcodeSuite::M218() {
} }
SERIAL_EOL(); SERIAL_EOL();
} }
}
#endif // HOTENDS > 1 #endif // HOTENDS > 1

2
Marlin/src/gcode/gcode.h

@ -161,7 +161,7 @@
* M209 - Turn Automatic Retract Detection on/off: S<0|1> (For slicers that don't support G10/11). (Requires FWRETRACT) * M209 - Turn Automatic Retract Detection on/off: S<0|1> (For slicers that don't support G10/11). (Requires FWRETRACT)
Every normal extrude-only move will be classified as retract depending on the direction. Every normal extrude-only move will be classified as retract depending on the direction.
* M211 - Enable, Disable, and/or Report software endstops: S<0|1> (Requires MIN_SOFTWARE_ENDSTOPS or MAX_SOFTWARE_ENDSTOPS) * M211 - Enable, Disable, and/or Report software endstops: S<0|1> (Requires MIN_SOFTWARE_ENDSTOPS or MAX_SOFTWARE_ENDSTOPS)
* M218 - Set a tool offset: "M218 T<index> X<offset> Y<offset>". (Requires 2 or more extruders) * M218 - Set/get a tool offset: "M218 T<index> X<offset> Y<offset>". (Requires 2 or more extruders)
* M220 - Set Feedrate Percentage: "M220 S<percent>" (i.e., "FR" on the LCD) * M220 - Set Feedrate Percentage: "M220 S<percent>" (i.e., "FR" on the LCD)
* M221 - Set Flow Percentage: "M221 S<percent>" * M221 - Set Flow Percentage: "M221 S<percent>"
* M226 - Wait until a pin is in a given state: "M226 P<pin> S<state>" * M226 - Wait until a pin is in a given state: "M226 P<pin> S<state>"

Loading…
Cancel
Save