Skip to content

Commit 5715633

Browse files
Bob-the-Kuhnernisv
authored andcommitted
🩹 Fix G61 axis parameters with no offset (MarlinFirmware#25312)
1 parent 2e7ac5e commit 5715633

File tree

1 file changed

+18
-5
lines changed
  • Marlin/src/gcode/feature/pause

1 file changed

+18
-5
lines changed

Marlin/src/gcode/feature/pause/G61.cpp

+18-5
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,24 @@
3535
/**
3636
* G61: Return to saved position
3737
*
38-
* F<rate> - Feedrate (optional) for the move back.
39-
* S<slot> - Slot # (0-based) to restore from (default 0).
40-
* X Y Z E - Axes to restore. At least one is required.
38+
* F<rate> - Feedrate (optional) for the move back.
39+
* S<slot> - Slot # (0-based) to restore from (default 0).
40+
* X<offset> - Restore X axis, applying the given offset (default 0)
41+
* Y<offset> - Restore Y axis, applying the given offset (default 0)
42+
* Z<offset> - Restore Z axis, applying the given offset (default 0)
4143
*
42-
* If XYZE are not given, default restore uses the smart blocking move.
44+
* If there is an Extruder:
45+
* E<offset> - Restore E axis, applying the given offset (default 0)
46+
*
47+
* With extra axes using default names:
48+
* A<offset> - Restore 4th axis, applying the given offset (default 0)
49+
* B<offset> - Restore 5th axis, applying the given offset (default 0)
50+
* C<offset> - Restore 6th axis, applying the given offset (default 0)
51+
* U<offset> - Restore 7th axis, applying the given offset (default 0)
52+
* V<offset> - Restore 8th axis, applying the given offset (default 0)
53+
* W<offset> - Restore 9th axis, applying the given offset (default 0)
54+
*
55+
* If no axes are specified then all axes are restored.
4356
*/
4457
void GcodeSuite::G61() {
4558

@@ -71,7 +84,7 @@ void GcodeSuite::G61() {
7184
if (parser.seen(STR_AXES_MAIN)) {
7285
DEBUG_ECHOPGM(STR_RESTORING_POS " S", slot);
7386
LOOP_NUM_AXES(i) {
74-
destination[i] = parser.seenval(AXIS_CHAR(i))
87+
destination[i] = parser.seen(AXIS_CHAR(i))
7588
? stored_position[slot][i] + parser.value_axis_units((AxisEnum)i)
7689
: current_position[i];
7790
DEBUG_CHAR(' ', AXIS_CHAR(i));

0 commit comments

Comments
 (0)