Followup to hotend_offset[Z] patch

This commit is contained in:
Scott Lahteine
2018-08-24 21:26:29 -05:00
parent e2b8fc4f17
commit d1c9517903
9 changed files with 25 additions and 39 deletions

View File

@ -22,7 +22,7 @@
#include "../../inc/MarlinConfig.h"
#if HOTENDS > 1
#if HAS_HOTEND_OFFSET
#include "../gcode.h"
#include "../../module/motion.h"
@ -37,7 +37,7 @@
* T<tool>
* X<xoffset>
* Y<yoffset>
* Z<zoffset> - Available with DUAL_X_CARRIAGE, SWITCHING_NOZZLE and PARKING_EXTRUDER
* Z<zoffset>
*/
void GcodeSuite::M218() {
if (get_target_extruder_from_command() || target_extruder == 0) return;
@ -51,13 +51,10 @@ void GcodeSuite::M218() {
hotend_offset[Y_AXIS][target_extruder] = parser.value_linear_units();
report = false;
}
#if HAS_HOTEND_OFFSET_Z
if (parser.seenval('Z')) {
hotend_offset[Z_AXIS][target_extruder] = parser.value_linear_units();
report = false;
}
#endif
if (parser.seenval('Z')) {
hotend_offset[Z_AXIS][target_extruder] = parser.value_linear_units();
report = false;
}
if (report) {
SERIAL_ECHO_START();
@ -67,10 +64,8 @@ void GcodeSuite::M218() {
SERIAL_ECHO(hotend_offset[X_AXIS][e]);
SERIAL_CHAR(',');
SERIAL_ECHO(hotend_offset[Y_AXIS][e]);
#if HAS_HOTEND_OFFSET_Z
SERIAL_CHAR(',');
SERIAL_ECHO(hotend_offset[Z_AXIS][e]);
#endif
SERIAL_CHAR(',');
SERIAL_ECHO(hotend_offset[Z_AXIS][e]);
}
SERIAL_EOL();
}
@ -81,4 +76,4 @@ void GcodeSuite::M218() {
#endif
}
#endif // HOTENDS > 1
#endif // HAS_HOTEND_OFFSET

View File

@ -65,7 +65,7 @@ void GcodeSuite::M125() {
// Lift Z axis
if (parser.seenval('Z')) park_point.z = parser.linearval('Z');
#if HOTENDS > 1 && DISABLED(DUAL_X_CARRIAGE) && DISABLED(DELTA)
#if HAS_HOTEND_OFFSET && DISABLED(DUAL_X_CARRIAGE) && DISABLED(DELTA)
park_point.x += (active_extruder ? hotend_offset[X_AXIS][active_extruder] : 0);
park_point.y += (active_extruder ? hotend_offset[Y_AXIS][active_extruder] : 0);
#endif

View File

@ -87,7 +87,7 @@ void GcodeSuite::M600() {
if (parser.seenval('X')) park_point.x = parser.linearval('X');
if (parser.seenval('Y')) park_point.y = parser.linearval('Y');
#if HOTENDS > 1 && DISABLED(DUAL_X_CARRIAGE) && DISABLED(DELTA)
#if HAS_HOTEND_OFFSET && DISABLED(DUAL_X_CARRIAGE) && DISABLED(DELTA)
park_point.x += (active_extruder ? hotend_offset[X_AXIS][active_extruder] : 0);
park_point.y += (active_extruder ? hotend_offset[Y_AXIS][active_extruder] : 0);
#endif