From 70d72354e2469eb66378e2da3a52ecd6db3f3447 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 22 Jun 2022 05:55:23 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Use=20MAP=20for=20home=20axis=20?= =?UTF-8?q?items?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/menu/menu_motion.cpp | 36 ++++------------------------- 1 file changed, 4 insertions(+), 32 deletions(-) diff --git a/Marlin/src/lcd/menu/menu_motion.cpp b/Marlin/src/lcd/menu/menu_motion.cpp index d7345039b5..2e79d2add2 100644 --- a/Marlin/src/lcd/menu/menu_motion.cpp +++ b/Marlin/src/lcd/menu/menu_motion.cpp @@ -316,6 +316,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 @@ -325,22 +327,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 + MAIN_AXIS_MAP(_HOME_ITEM); END_MENU(); } @@ -378,22 +365,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 + MAIN_AXIS_MAP(_HOME_ITEM); #endif #endif