Skip to content

Commit de1c7bd

Browse files
committed
Revert move menu string optimization
🐛 Fix Axis Homing (#24425) 🐛 Fix Manual Move axis selection (#24404) 🎨 Simplify move menus with substitution (975c8f4)
1 parent 48e4863 commit de1c7bd

File tree

1 file changed

+29
-6
lines changed

1 file changed

+29
-6
lines changed

Marlin/src/lcd/menu/menu_motion.cpp

+29-6
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@
5050
// "Motion" > "Move Axis" submenu
5151
//
5252

53-
void lcd_move_axis(const AxisEnum axis) {
53+
// TODO: Use substitution here with MSG_MOVE_N
54+
static void _lcd_move_xyz(FSTR_P const name, const AxisEnum axis) {
5455
if (ui.use_click()) return ui.goto_previous_screen_no_defer();
5556
if (ui.encoderPosition && !ui.manual_move.processing) {
5657
// Get motion limit from software endstops, if any
@@ -77,15 +78,37 @@ void lcd_move_axis(const AxisEnum axis) {
7778
const float pos = ui.manual_move.axis_value(axis);
7879
if (parser.using_inch_units()) {
7980
const float imp_pos = LINEAR_UNIT(pos);
80-
MenuEditItemBase::draw_edit_screen(GET_TEXT_F(MSG_MOVE_N), ftostr63(imp_pos));
81+
MenuEditItemBase::draw_edit_screen(name, ftostr63(imp_pos));
8182
}
8283
else
83-
MenuEditItemBase::draw_edit_screen(GET_TEXT_F(MSG_MOVE_N), ui.manual_move.menu_scale >= 0.1f ? (LARGE_AREA_TEST ? ftostr51sign(pos) : ftostr41sign(pos)) : ftostr63(pos));
84+
MenuEditItemBase::draw_edit_screen(name, ui.manual_move.menu_scale >= 0.1f ? (LARGE_AREA_TEST ? ftostr51sign(pos) : ftostr41sign(pos)) : ftostr63(pos));
8485
}
8586
}
86-
87-
// Move Z easy accessor
88-
void lcd_move_z() { lcd_move_axis(Z_AXIS); }
87+
void lcd_move_x() { _lcd_move_xyz(GET_TEXT_F(MSG_MOVE_X), X_AXIS); }
88+
#if HAS_Y_AXIS
89+
void lcd_move_y() { _lcd_move_xyz(GET_TEXT_F(MSG_MOVE_Y), Y_AXIS); }
90+
#endif
91+
#if HAS_Z_AXIS
92+
void lcd_move_z() { _lcd_move_xyz(GET_TEXT_F(MSG_MOVE_Z), Z_AXIS); }
93+
#endif
94+
#if HAS_I_AXIS
95+
void lcd_move_i() { _lcd_move_xyz(GET_TEXT_F(MSG_MOVE_I), I_AXIS); }
96+
#endif
97+
#if HAS_J_AXIS
98+
void lcd_move_j() { _lcd_move_xyz(GET_TEXT_F(MSG_MOVE_J), J_AXIS); }
99+
#endif
100+
#if HAS_K_AXIS
101+
void lcd_move_k() { _lcd_move_xyz(GET_TEXT_F(MSG_MOVE_K), K_AXIS); }
102+
#endif
103+
#if HAS_U_AXIS
104+
void lcd_move_u() { _lcd_move_xyz(GET_TEXT_F(MSG_MOVE_U), U_AXIS); }
105+
#endif
106+
#if HAS_V_AXIS
107+
void lcd_move_v() { _lcd_move_xyz(GET_TEXT_F(MSG_MOVE_V), V_AXIS); }
108+
#endif
109+
#if HAS_W_AXIS
110+
void lcd_move_w() { _lcd_move_xyz(GET_TEXT_F(MSG_MOVE_W), W_AXIS); }
111+
#endif
89112

90113
#if E_MANUAL
91114

0 commit comments

Comments
 (0)