Skip to content

Commit

Permalink
🎨 Use MAP for home axis items
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Jun 21, 2022
1 parent 432c879 commit 4520a51
Showing 1 changed file with 4 additions and 50 deletions.
54 changes: 4 additions & 50 deletions Marlin/src/lcd/menu/menu_motion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,8 @@ void menu_move() {
END_MENU();
}

#define _HOME_ITEM(N) GCODES_ITEM_N(N##_AXIS, MSG_AUTO_HOME_A, F("G28X" STR_##N));

#if ENABLED(INDIVIDUAL_AXIS_HOMING_SUBMENU)
//
// "Motion" > "Homing" submenu
Expand All @@ -338,31 +340,7 @@ void menu_move() {
BACK_ITEM(MSG_MOTION);

GCODES_ITEM(MSG_AUTO_HOME, FPSTR(G28_STR));
GCODES_ITEM_N(X_AXIS, MSG_AUTO_HOME_A, F("G28X"));
#if HAS_Y_AXIS
GCODES_ITEM_N(Y_AXIS, MSG_AUTO_HOME_A, F("G28Y"));
#endif
#if HAS_Z_AXIS
GCODES_ITEM_N(Z_AXIS, MSG_AUTO_HOME_A, F("G28Z"));
#endif
#if HAS_I_AXIS
GCODES_ITEM_N(I_AXIS, MSG_AUTO_HOME_A, F("G28" STR_I));
#endif
#if HAS_J_AXIS
GCODES_ITEM_N(J_AXIS, MSG_AUTO_HOME_A, F("G28" STR_J));
#endif
#if HAS_K_AXIS
GCODES_ITEM_N(K_AXIS, MSG_AUTO_HOME_A, F("G28" STR_K));
#endif
#if HAS_U_AXIS
GCODES_ITEM_N(U_AXIS, MSG_AUTO_HOME_A, F("G28" STR_U));
#endif
#if HAS_V_AXIS
GCODES_ITEM_N(V_AXIS, MSG_AUTO_HOME_A, F("G28" STR_V));
#endif
#if HAS_W_AXIS
GCODES_ITEM_N(W_AXIS, MSG_AUTO_HOME_A, F("G28" STR_W));
#endif
MAIN_AXIS_MAP(_HOME_ITEM);

END_MENU();
}
Expand Down Expand Up @@ -400,31 +378,7 @@ void menu_motion() {
#else
GCODES_ITEM(MSG_AUTO_HOME, FPSTR(G28_STR));
#if ENABLED(INDIVIDUAL_AXIS_HOMING_MENU)
GCODES_ITEM_N(X_AXIS, MSG_AUTO_HOME_A, F("G28X"));
#if HAS_Y_AXIS
GCODES_ITEM_N(Y_AXIS, MSG_AUTO_HOME_A, F("G28Y"));
#endif
#if HAS_Z_AXIS
GCODES_ITEM_N(Z_AXIS, MSG_AUTO_HOME_A, F("G28Z"));
#endif
#if HAS_I_AXIS
GCODES_ITEM_N(I_AXIS, MSG_AUTO_HOME_A, F("G28" STR_I));
#endif
#if HAS_J_AXIS
GCODES_ITEM_N(J_AXIS, MSG_AUTO_HOME_A, F("G28" STR_J));
#endif
#if HAS_K_AXIS
GCODES_ITEM_N(K_AXIS, MSG_AUTO_HOME_A, F("G28" STR_K));
#endif
#if HAS_U_AXIS
GCODES_ITEM_N(U_AXIS, MSG_AUTO_HOME_A, F("G28" STR_U));
#endif
#if HAS_V_AXIS
GCODES_ITEM_N(V_AXIS, MSG_AUTO_HOME_A, F("G28" STR_V));
#endif
#if HAS_W_AXIS
GCODES_ITEM_N(W_AXIS, MSG_AUTO_HOME_A, F("G28" STR_W));
#endif
MAIN_AXIS_MAP(_HOME_ITEM);
#endif
#endif

Expand Down

0 comments on commit 4520a51

Please sign in to comment.