Skip to content

Commit 41f80a4

Browse files
DerAndere1thinkyhead
authored andcommitted
🚸 Include extra axes in position report (#23490)
1 parent e0f75d4 commit 41f80a4

3 files changed

Lines changed: 20 additions & 21 deletions

File tree

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,16 @@ void GcodeSuite::G60() {
4747
SBI(saved_slots[slot >> 3], slot & 0x07);
4848

4949
#if ENABLED(SAVED_POSITIONS_DEBUG)
50+
{
5051
DEBUG_ECHOPGM(STR_SAVED_POS " S", slot);
5152
const xyze_pos_t &pos = stored_position[slot];
5253
DEBUG_ECHOLNPAIR_F_P(
53-
LIST_N(DOUBLE(LOGICAL_AXES), SP_E_STR, pos.e,
54-
PSTR(" : X"), pos.x, SP_Y_STR, pos.y, SP_Z_STR, pos.z,
55-
SP_I_STR, pos.i, SP_J_STR, pos.j, SP_K_STR, pos.k)
54+
LIST_N(DOUBLE(LINEAR_AXES), PSTR(" : X"), pos.x, SP_Y_STR, pos.y, SP_Z_STR, pos.z, SP_I_STR, pos.i, SP_J_STR, pos.j, SP_K_STR, pos.k)
55+
#if HAS_EXTRUDERS
56+
, SP_E_STR, pos.e
57+
#endif
5658
);
59+
}
5760
#endif
5861
}
5962

Marlin/src/lcd/marlinui.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,7 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP;
771771
// Add a manual move to the queue?
772772
if (axis != NO_AXIS_ENUM && ELAPSED(millis(), start_time) && !planner.is_full()) {
773773

774-
const feedRate_t fr_mm_s = (axis <= LOGICAL_AXES) ? manual_feedrate_mm_s[axis] : XY_PROBE_FEEDRATE_MM_S;
774+
const feedRate_t fr_mm_s = (axis < LOGICAL_AXES) ? manual_feedrate_mm_s[axis] : XY_PROBE_FEEDRATE_MM_S;
775775

776776
#if IS_KINEMATIC
777777

Marlin/src/module/motion.cpp

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,7 @@ void report_real_position() {
217217
xyze_pos_t npos = LOGICAL_AXIS_ARRAY(
218218
planner.get_axis_position_mm(E_AXIS),
219219
cartes.x, cartes.y, cartes.z,
220-
planner.get_axis_position_mm(I_AXIS),
221-
planner.get_axis_position_mm(J_AXIS),
222-
planner.get_axis_position_mm(K_AXIS)
220+
cartes.i, cartes.j, cartes.k
223221
);
224222

225223
TERN_(HAS_POSITION_MODIFIERS, planner.unapply_modifiers(npos, true));
@@ -263,27 +261,25 @@ void report_current_position_projected() {
263261
* Output the current position (processed) to serial while moving
264262
*/
265263
void report_current_position_moving() {
266-
267264
get_cartesian_from_steppers();
268265
const xyz_pos_t lpos = cartes.asLogical();
269-
SERIAL_ECHOPGM(
270-
"X:", lpos.x
271-
#if HAS_Y_AXIS
272-
, " Y:", lpos.y
273-
#endif
274-
#if HAS_Z_AXIS
275-
, " Z:", lpos.z
276-
#endif
266+
267+
SERIAL_ECHOPGM_P(
268+
LIST_N(DOUBLE(LINEAR_AXES),
269+
X_LBL, lpos.x,
270+
SP_Y_LBL, lpos.y,
271+
SP_Z_LBL, lpos.z,
272+
SP_I_LBL, lpos.i,
273+
SP_J_LBL, lpos.j,
274+
SP_K_LBL, lpos.k
275+
)
277276
#if HAS_EXTRUDERS
278-
, " E:", current_position.e
277+
, SP_E_LBL, current_position.e
279278
#endif
280279
);
281280

282281
stepper.report_positions();
283-
#if IS_SCARA
284-
scara_report_positions();
285-
#endif
286-
282+
TERN_(IS_SCARA, scara_report_positions());
287283
report_current_grblstate_moving();
288284
}
289285

0 commit comments

Comments
 (0)