From 0c181fc9d3ebd77d613cff63ccb82f2e4d4c39ec Mon Sep 17 00:00:00 2001 From: Bob Kuhn Date: Mon, 30 Jan 2023 21:57:36 -0600 Subject: [PATCH] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20G61=20axis=20parameters=20?= =?UTF-8?q?with=20no=20offset=20(#25312)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/gcode/feature/pause/G61.cpp | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/Marlin/src/gcode/feature/pause/G61.cpp b/Marlin/src/gcode/feature/pause/G61.cpp index b85487af45..889709c045 100644 --- a/Marlin/src/gcode/feature/pause/G61.cpp +++ b/Marlin/src/gcode/feature/pause/G61.cpp @@ -35,11 +35,24 @@ /** * G61: Return to saved position * - * F - Feedrate (optional) for the move back. - * S - Slot # (0-based) to restore from (default 0). - * X Y Z E - Axes to restore. At least one is required. + * F - Feedrate (optional) for the move back. + * S - Slot # (0-based) to restore from (default 0). + * X - Restore X axis, applying the given offset (default 0) + * Y - Restore Y axis, applying the given offset (default 0) + * Z - Restore Z axis, applying the given offset (default 0) * - * If XYZE are not given, default restore uses the smart blocking move. + * If there is an Extruder: + * E - Restore E axis, applying the given offset (default 0) + * + * With extra axes using default names: + * A - Restore 4th axis, applying the given offset (default 0) + * B - Restore 5th axis, applying the given offset (default 0) + * C - Restore 6th axis, applying the given offset (default 0) + * U - Restore 7th axis, applying the given offset (default 0) + * V - Restore 8th axis, applying the given offset (default 0) + * W - Restore 9th axis, applying the given offset (default 0) + * + * If no axes are specified then all axes are restored. */ void GcodeSuite::G61() { @@ -71,7 +84,7 @@ void GcodeSuite::G61() { if (parser.seen(STR_AXES_MAIN)) { DEBUG_ECHOPGM(STR_RESTORING_POS " S", slot); LOOP_NUM_AXES(i) { - destination[i] = parser.seenval(AXIS_CHAR(i)) + destination[i] = parser.seen(AXIS_CHAR(i)) ? stored_position[slot][i] + parser.value_axis_units((AxisEnum)i) : current_position[i]; DEBUG_CHAR(' ', AXIS_CHAR(i));