From 3892d08b06ce3c24be5d0d9c150e0ab035ba9ff0 Mon Sep 17 00:00:00 2001 From: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com> Date: Thu, 11 Aug 2022 11:35:36 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Fix=20UBL?= =?UTF-8?q?=20Build=20Mesh=20preheat=20items=20(#24598)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/src/lcd/menu/menu_ubl.cpp | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/Marlin/src/lcd/menu/menu_ubl.cpp b/Marlin/src/lcd/menu/menu_ubl.cpp index 62c1770bd4..f26e5b2984 100644 --- a/Marlin/src/lcd/menu/menu_ubl.cpp +++ b/Marlin/src/lcd/menu/menu_ubl.cpp @@ -312,11 +312,7 @@ void _lcd_ubl_build_mesh() { START_MENU(); BACK_ITEM(MSG_UBL_TOOLS); #if HAS_PREHEAT - #if HAS_HEATED_BED - #define PREHEAT_BED_GCODE(M) "M190I" STRINGIFY(M) "\n" - #else - #define PREHEAT_BED_GCODE(M) "" - #endif + #define PREHEAT_BED_GCODE(M) TERN(HAS_HEATED_BED, "M190I" STRINGIFY(M) "\n", "") #define BUILD_MESH_GCODE_ITEM(M) GCODES_ITEM_f(ui.get_preheat_label(M), MSG_UBL_BUILD_MESH_M, \ F( \ "G28\n" \ @@ -325,20 +321,8 @@ void _lcd_ubl_build_mesh() { "G29P1\n" \ "M104S0\n" \ "M140S0" \ - ) ) - BUILD_MESH_GCODE_ITEM(0); - #if PREHEAT_COUNT > 1 - BUILD_MESH_GCODE_ITEM(1); - #if PREHEAT_COUNT > 2 - BUILD_MESH_GCODE_ITEM(2); - #if PREHEAT_COUNT > 3 - BUILD_MESH_GCODE_ITEM(3); - #if PREHEAT_COUNT > 4 - BUILD_MESH_GCODE_ITEM(4); - #endif - #endif - #endif - #endif + ) ); + REPEAT(PREHEAT_COUNT, BUILD_MESH_GCODE_ITEM) #endif // HAS_PREHEAT SUBMENU(MSG_UBL_BUILD_CUSTOM_MESH, _lcd_ubl_custom_mesh);