diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 051560981e..73f6bbcdda 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -1884,7 +1884,7 @@ // @section temperature // -// Preheat Constants - Up to 5 are supported without changes +// Preheat Constants - Up to 6 are supported without changes // #define PREHEAT_1_LABEL "PLA" #define PREHEAT_1_TEMP_HOTEND 180 diff --git a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp index 3e777d4aaa..dbf03aa0f3 100644 --- a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp @@ -1012,10 +1012,62 @@ void CrealityDWINClass::Update_Status_Bar(bool refresh/*=false*/) { /* Menu Item Config */ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/*=true*/) { - uint8_t row = item - scrollpos; + const uint8_t row = item - scrollpos; #if HAS_LEVELING static bool level_state; #endif + + #if HAS_PREHEAT + + #define PREHEAT_BACK 0 + #define PREHEAT_SUBMENU_HOTEND (PREHEAT_BACK + ENABLED(HAS_HOTEND)) + #define PREHEAT_SUBMENU_BED (PREHEAT_SUBMENU_HOTEND + ENABLED(HAS_HEATED_BED)) + #define PREHEAT_SUBMENU_FAN (PREHEAT_SUBMENU_BED + ENABLED(HAS_FAN)) + #define PREHEAT_SUBMENU_TOTAL PREHEAT_SUBMENU_FAN + + auto preheat_submenu = [&](const int index, const uint8_t item, const uint8_t sel) { + switch (item) { + case PREHEAT_BACK: + if (draw) + Draw_Menu_Item(row, ICON_Back, F("Back")); + else + Draw_Menu(TempMenu, sel); + break; + #if HAS_HOTEND + case PREHEAT_SUBMENU_HOTEND: + if (draw) { + Draw_Menu_Item(row, ICON_SetEndTemp, F("Hotend")); + Draw_Float(ui.material_preset[index].hotend_temp, row, false, 1); + } + else + Modify_Value(ui.material_preset[index].hotend_temp, MIN_E_TEMP, MAX_E_TEMP, 1); + break; + #endif + #if HAS_HEATED_BED + case PREHEAT_SUBMENU_BED: + if (draw) { + Draw_Menu_Item(row, ICON_SetBedTemp, F("Bed")); + Draw_Float(ui.material_preset[index].bed_temp, row, false, 1); + } + else + Modify_Value(ui.material_preset[index].bed_temp, MIN_BED_TEMP, MAX_BED_TEMP, 1); + break; + #endif + #if HAS_FAN + case PREHEAT_SUBMENU_FAN: + if (draw) { + Draw_Menu_Item(row, ICON_FanSpeed, F("Fan")); + Draw_Float(ui.material_preset[index].fan_speed, row, false, 1); + } + else + Modify_Value(ui.material_preset[index].fan_speed, MIN_FAN_SPEED, MAX_FAN_SPEED, 1); + break; + #endif + } + }; + + #endif + switch (menu) { case Prepare: @@ -1584,7 +1636,6 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ #if HAS_PREHEAT case Preheat: { - #define PREHEAT_BACK 0 #define PREHEAT_MODE (PREHEAT_BACK + 1) #define PREHEAT_1 (PREHEAT_MODE + 1) #define PREHEAT_2 (PREHEAT_1 + (PREHEAT_COUNT >= 2)) @@ -1606,6 +1657,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ else Draw_Menu(Prepare, PREPARE_PREHEAT); break; + case PREHEAT_MODE: if (draw) { Draw_Menu_Item(row, ICON_Homing, F("Preheat Mode")); @@ -1615,50 +1667,13 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ Modify_Option(preheatmode, preheat_modes, 2); break; - #if PREHEAT_COUNT >= 1 - case PREHEAT_1: - if (draw) - Draw_Menu_Item(row, ICON_Temperature, F(PREHEAT_1_LABEL)); - else - do_preheat(0); - break; - #endif + #define _PREHEAT_CASE(N) \ + case PREHEAT_##N: { \ + if (draw) Draw_Menu_Item(row, ICON_Temperature, F(PREHEAT_## N ##_LABEL)); \ + else do_preheat(N - 1); \ + } break; - #if PREHEAT_COUNT >= 2 - case PREHEAT_2: - if (draw) - Draw_Menu_Item(row, ICON_Temperature, F(PREHEAT_2_LABEL)); - else - do_preheat(1); - break; - #endif - - #if PREHEAT_COUNT >= 3 - case PREHEAT_3: - if (draw) - Draw_Menu_Item(row, ICON_Temperature, F(PREHEAT_3_LABEL)); - else - do_preheat(2); - break; - #endif - - #if PREHEAT_COUNT >= 4 - case PREHEAT_4: - if (draw) - Draw_Menu_Item(row, ICON_Temperature, F(PREHEAT_4_LABEL)); - else - do_preheat(3); - break; - #endif - - #if PREHEAT_COUNT >= 5 - case PREHEAT_5: - if (draw) - Draw_Menu_Item(row, ICON_Temperature, F(PREHEAT_5_LABEL)); - else - do_preheat(4); - break; - #endif + REPEAT_1(PREHEAT_COUNT, _PREHEAT_CASE) } } break; #endif // HAS_PREHEAT @@ -1871,46 +1886,14 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ Draw_Menu(PID); break; #endif - #if PREHEAT_COUNT >= 1 - case TEMP_PREHEAT1: - if (draw) - Draw_Menu_Item(row, ICON_Step, F(PREHEAT_1_LABEL), nullptr, true); - else - Draw_Menu(Preheat1); - break; - #endif - #if PREHEAT_COUNT >= 2 - case TEMP_PREHEAT2: - if (draw) - Draw_Menu_Item(row, ICON_Step, F(PREHEAT_2_LABEL), nullptr, true); - else - Draw_Menu(Preheat2); - break; - #endif - #if PREHEAT_COUNT >= 3 - case TEMP_PREHEAT3: - if (draw) - Draw_Menu_Item(row, ICON_Step, F(PREHEAT_3_LABEL), nullptr, true); - else - Draw_Menu(Preheat3); - break; - #endif - #if PREHEAT_COUNT >= 4 - case TEMP_PREHEAT4: - if (draw) - Draw_Menu_Item(row, ICON_Step, F(PREHEAT_4_LABEL), nullptr, true); - else - Draw_Menu(Preheat4); - break; - #endif - #if PREHEAT_COUNT >= 5 - case TEMP_PREHEAT5: - if (draw) - Draw_Menu_Item(row, ICON_Step, F(PREHEAT_5_LABEL), nullptr, true); - else - Draw_Menu(Preheat5); - break; - #endif + + #define _TEMP_PREHEAT_CASE(N) \ + case TEMP_PREHEAT##N: { \ + if (draw) Draw_Menu_Item(row, ICON_Step, F(PREHEAT_## N ##_LABEL), nullptr, true); \ + else Draw_Menu(Preheat##N); \ + } break; + + REPEAT_1(PREHEAT_COUNT, _TEMP_PREHEAT_CASE) } break; @@ -2095,255 +2078,10 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; #endif // HAS_HEATED_BED - #if PREHEAT_COUNT >= 1 - case Preheat1: - - #define PREHEAT1_BACK 0 - #define PREHEAT1_HOTEND (PREHEAT1_BACK + ENABLED(HAS_HOTEND)) - #define PREHEAT1_BED (PREHEAT1_HOTEND + ENABLED(HAS_HEATED_BED)) - #define PREHEAT1_FAN (PREHEAT1_BED + ENABLED(HAS_FAN)) - #define PREHEAT1_TOTAL PREHEAT1_FAN - - switch (item) { - case PREHEAT1_BACK: - if (draw) - Draw_Menu_Item(row, ICON_Back, F("Back")); - else - Draw_Menu(TempMenu, TEMP_PREHEAT1); - break; - #if HAS_HOTEND - case PREHEAT1_HOTEND: - if (draw) { - Draw_Menu_Item(row, ICON_SetEndTemp, F("Hotend")); - Draw_Float(ui.material_preset[0].hotend_temp, row, false, 1); - } - else - Modify_Value(ui.material_preset[0].hotend_temp, MIN_E_TEMP, MAX_E_TEMP, 1); - break; - #endif - #if HAS_HEATED_BED - case PREHEAT1_BED: - if (draw) { - Draw_Menu_Item(row, ICON_SetBedTemp, F("Bed")); - Draw_Float(ui.material_preset[0].bed_temp, row, false, 1); - } - else - Modify_Value(ui.material_preset[0].bed_temp, MIN_BED_TEMP, MAX_BED_TEMP, 1); - break; - #endif - #if HAS_FAN - case PREHEAT1_FAN: - if (draw) { - Draw_Menu_Item(row, ICON_FanSpeed, F("Fan")); - Draw_Float(ui.material_preset[0].fan_speed, row, false, 1); - } - else - Modify_Value(ui.material_preset[0].fan_speed, MIN_FAN_SPEED, MAX_FAN_SPEED, 1); - break; - #endif - } - break; - #endif // PREHEAT_COUNT >= 1 - - #if PREHEAT_COUNT >= 2 - case Preheat2: - - #define PREHEAT2_BACK 0 - #define PREHEAT2_HOTEND (PREHEAT2_BACK + ENABLED(HAS_HOTEND)) - #define PREHEAT2_BED (PREHEAT2_HOTEND + ENABLED(HAS_HEATED_BED)) - #define PREHEAT2_FAN (PREHEAT2_BED + ENABLED(HAS_FAN)) - #define PREHEAT2_TOTAL PREHEAT2_FAN - - switch (item) { - case PREHEAT2_BACK: - if (draw) - Draw_Menu_Item(row, ICON_Back, F("Back")); - else - Draw_Menu(TempMenu, TEMP_PREHEAT2); - break; - #if HAS_HOTEND - case PREHEAT2_HOTEND: - if (draw) { - Draw_Menu_Item(row, ICON_SetEndTemp, F("Hotend")); - Draw_Float(ui.material_preset[1].hotend_temp, row, false, 1); - } - else - Modify_Value(ui.material_preset[1].hotend_temp, MIN_E_TEMP, MAX_E_TEMP, 1); - break; - #endif - #if HAS_HEATED_BED - case PREHEAT2_BED: - if (draw) { - Draw_Menu_Item(row, ICON_SetBedTemp, F("Bed")); - Draw_Float(ui.material_preset[1].bed_temp, row, false, 1); - } - else - Modify_Value(ui.material_preset[1].bed_temp, MIN_BED_TEMP, MAX_BED_TEMP, 1); - break; - #endif - #if HAS_FAN - case PREHEAT2_FAN: - if (draw) { - Draw_Menu_Item(row, ICON_FanSpeed, F("Fan")); - Draw_Float(ui.material_preset[1].fan_speed, row, false, 1); - } - else - Modify_Value(ui.material_preset[1].fan_speed, MIN_FAN_SPEED, MAX_FAN_SPEED, 1); - break; - #endif - } - break; - #endif // PREHEAT_COUNT >= 2 - - #if PREHEAT_COUNT >= 3 - case Preheat3: - - #define PREHEAT3_BACK 0 - #define PREHEAT3_HOTEND (PREHEAT3_BACK + ENABLED(HAS_HOTEND)) - #define PREHEAT3_BED (PREHEAT3_HOTEND + ENABLED(HAS_HEATED_BED)) - #define PREHEAT3_FAN (PREHEAT3_BED + ENABLED(HAS_FAN)) - #define PREHEAT3_TOTAL PREHEAT3_FAN - - switch (item) { - case PREHEAT3_BACK: - if (draw) - Draw_Menu_Item(row, ICON_Back, F("Back")); - else - Draw_Menu(TempMenu, TEMP_PREHEAT3); - break; - #if HAS_HOTEND - case PREHEAT3_HOTEND: - if (draw) { - Draw_Menu_Item(row, ICON_SetEndTemp, F("Hotend")); - Draw_Float(ui.material_preset[2].hotend_temp, row, false, 1); - } - else - Modify_Value(ui.material_preset[2].hotend_temp, MIN_E_TEMP, MAX_E_TEMP, 1); - break; - #endif - #if HAS_HEATED_BED - case PREHEAT3_BED: - if (draw) { - Draw_Menu_Item(row, ICON_SetBedTemp, F("Bed")); - Draw_Float(ui.material_preset[2].bed_temp, row, false, 1); - } - else - Modify_Value(ui.material_preset[2].bed_temp, MIN_BED_TEMP, MAX_BED_TEMP, 1); - break; - #endif - #if HAS_FAN - case PREHEAT3_FAN: - if (draw) { - Draw_Menu_Item(row, ICON_FanSpeed, F("Fan")); - Draw_Float(ui.material_preset[2].fan_speed, row, false, 1); - } - else - Modify_Value(ui.material_preset[2].fan_speed, MIN_FAN_SPEED, MAX_FAN_SPEED, 1); - break; - #endif - } - break; - #endif // PREHEAT_COUNT >= 3 - - #if PREHEAT_COUNT >= 4 - case Preheat4: - - #define PREHEAT4_BACK 0 - #define PREHEAT4_HOTEND (PREHEAT4_BACK + ENABLED(HAS_HOTEND)) - #define PREHEAT4_BED (PREHEAT4_HOTEND + ENABLED(HAS_HEATED_BED)) - #define PREHEAT4_FAN (PREHEAT4_BED + ENABLED(HAS_FAN)) - #define PREHEAT4_TOTAL PREHEAT4_FAN - - switch (item) { - case PREHEAT4_BACK: - if (draw) - Draw_Menu_Item(row, ICON_Back, F("Back")); - else - Draw_Menu(TempMenu, TEMP_PREHEAT4); - break; - #if HAS_HOTEND - case PREHEAT4_HOTEND: - if (draw) { - Draw_Menu_Item(row, ICON_SetEndTemp, F("Hotend")); - Draw_Float(ui.material_preset[3].hotend_temp, row, false, 1); - } - else - Modify_Value(ui.material_preset[3].hotend_temp, MIN_E_TEMP, MAX_E_TEMP, 1); - break; - #endif - #if HAS_HEATED_BED - case PREHEAT4_BED: - if (draw) { - Draw_Menu_Item(row, ICON_SetBedTemp, F("Bed")); - Draw_Float(ui.material_preset[3].bed_temp, row, false, 1); - } - else - Modify_Value(ui.material_preset[3].bed_temp, MIN_BED_TEMP, MAX_BED_TEMP, 1); - break; - #endif - #if HAS_FAN - case PREHEAT4_FAN: - if (draw) { - Draw_Menu_Item(row, ICON_FanSpeed, F("Fan")); - Draw_Float(ui.material_preset[3].fan_speed, row, false, 1); - } - else - Modify_Value(ui.material_preset[3].fan_speed, MIN_FAN_SPEED, MAX_FAN_SPEED, 1); - break; - #endif - } - break; - #endif // PREHEAT_COUNT >= 4 - - #if PREHEAT_COUNT >= 5 - case Preheat5: - - #define PREHEAT5_BACK 0 - #define PREHEAT5_HOTEND (PREHEAT5_BACK + ENABLED(HAS_HOTEND)) - #define PREHEAT5_BED (PREHEAT5_HOTEND + ENABLED(HAS_HEATED_BED)) - #define PREHEAT5_FAN (PREHEAT5_BED + ENABLED(HAS_FAN)) - #define PREHEAT5_TOTAL PREHEAT5_FAN - - switch (item) { - case PREHEAT5_BACK: - if (draw) - Draw_Menu_Item(row, ICON_Back, F("Back")); - else - Draw_Menu(TempMenu, TEMP_PREHEAT5); - break; - #if HAS_HOTEND - case PREHEAT5_HOTEND: - if (draw) { - Draw_Menu_Item(row, ICON_SetEndTemp, F("Hotend")); - Draw_Float(ui.material_preset[4].hotend_temp, row, false, 1); - } - else - Modify_Value(ui.material_preset[4].hotend_temp, MIN_E_TEMP, MAX_E_TEMP, 1); - break; - #endif - #if HAS_HEATED_BED - case PREHEAT5_BED: - if (draw) { - Draw_Menu_Item(row, ICON_SetBedTemp, F("Bed")); - Draw_Float(ui.material_preset[4].bed_temp, row, false, 1); - } - else - Modify_Value(ui.material_preset[4].bed_temp, MIN_BED_TEMP, MAX_BED_TEMP, 1); - break; - #endif - #if HAS_FAN - case PREHEAT5_FAN: - if (draw) { - Draw_Menu_Item(row, ICON_FanSpeed, F("Fan")); - Draw_Float(ui.material_preset[4].fan_speed, row, false, 1); - } - else - Modify_Value(ui.material_preset[4].fan_speed, MIN_FAN_SPEED, MAX_FAN_SPEED, 1); - break; - #endif - } - break; - #endif // PREHEAT_COUNT >= 5 + #if HAS_PREHEAT + #define _PREHEAT_SUBMENU_CASE(N) case Preheat##N: preheat_submenu(N, item, TEMP_PREHEAT##N); break; + REPEAT_1(PREHEAT_COUNT, _PREHEAT_SUBMENU_CASE) + #endif case Motion: @@ -3855,7 +3593,9 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ } break; - case PreheatHotend: + #if HAS_PREHEAT && HAS_HOTEND + + case PreheatHotend: #define PREHEATHOTEND_BACK 0 #define PREHEATHOTEND_CONTINUE (PREHEATHOTEND_BACK + 1) @@ -3918,46 +3658,16 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ } } break; - #if PREHEAT_COUNT >= 1 - case PREHEATHOTEND_1: - if (draw) - Draw_Menu_Item(row, ICON_Temperature, F(PREHEAT_1_LABEL)); - else - ui.preheat_hotend_and_fan(0); + + + #define _PREHEAT_HOTEND_CASE(N) \ + case PREHEATHOTEND_##N: \ + if (draw) Draw_Menu_Item(row, ICON_Temperature, F(PREHEAT_## N ##_LABEL)); \ + else ui.preheat_hotend_and_fan((N) - 1); \ break; - #endif - #if PREHEAT_COUNT >= 2 - case PREHEATHOTEND_2: - if (draw) - Draw_Menu_Item(row, ICON_Temperature, F(PREHEAT_2_LABEL)); - else - ui.preheat_hotend_and_fan(1); - break; - #endif - #if PREHEAT_COUNT >= 3 - case PREHEATHOTEND_3: - if (draw) - Draw_Menu_Item(row, ICON_Temperature, F(PREHEAT_3_LABEL)); - else - ui.preheat_hotend_and_fan(2); - break; - #endif - #if PREHEAT_COUNT >= 4 - case PREHEATHOTEND_4: - if (draw) - Draw_Menu_Item(row, ICON_Temperature, F(PREHEAT_4_LABEL)); - else - ui.preheat_hotend_and_fan(3); - break; - #endif - #if PREHEAT_COUNT >= 5 - case PREHEATHOTEND_5: - if (draw) - Draw_Menu_Item(row, ICON_Temperature, F(PREHEAT_5_LABEL)); - else - ui.preheat_hotend_and_fan(4); - break; - #endif + + REPEAT_1(PREHEAT_COUNT, _PREHEAT_HOTEND_CASE) + case PREHEATHOTEND_CUSTOM: if (draw) { Draw_Menu_Item(row, ICON_Temperature, F("Custom")); @@ -3968,6 +3678,8 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/ break; } break; + + #endif // HAS_PREHEAT && HAS_HOTEND } } @@ -3998,20 +3710,9 @@ FSTR_P CrealityDWINClass::Get_Menu_Title(uint8_t menu) { #if HAS_HEATED_BED case BedPID: return F("Bed PID Settings"); #endif - #if PREHEAT_COUNT >= 1 - case Preheat1: return F(PREHEAT_1_LABEL " Settings"); - #endif - #if PREHEAT_COUNT >= 2 - case Preheat2: return F(PREHEAT_2_LABEL " Settings"); - #endif - #if PREHEAT_COUNT >= 3 - case Preheat3: return F(PREHEAT_3_LABEL " Settings"); - #endif - #if PREHEAT_COUNT >= 4 - case Preheat4: return F(PREHEAT_4_LABEL " Settings"); - #endif - #if PREHEAT_COUNT >= 5 - case Preheat5: return F(PREHEAT_5_LABEL " Settings"); + #if HAS_PREHEAT + #define _PREHEAT_TITLE_CASE(N) case Preheat##N: return F(PREHEAT_## N ##_LABEL " Settings"); + REPEAT_1(PREHEAT_COUNT, _PREHEAT_TITLE_CASE) #endif case Motion: return F("Motion Settings"); case HomeOffsets: return F("Home Offsets"); @@ -4074,20 +3775,9 @@ uint8_t CrealityDWINClass::Get_Menu_Size(uint8_t menu) { #if HAS_HEATED_BED case BedPID: return BEDPID_TOTAL; #endif - #if PREHEAT_COUNT >= 1 - case Preheat1: return PREHEAT1_TOTAL; - #endif - #if PREHEAT_COUNT >= 2 - case Preheat2: return PREHEAT2_TOTAL; - #endif - #if PREHEAT_COUNT >= 3 - case Preheat3: return PREHEAT3_TOTAL; - #endif - #if PREHEAT_COUNT >= 4 - case Preheat4: return PREHEAT4_TOTAL; - #endif - #if PREHEAT_COUNT >= 5 - case Preheat5: return PREHEAT5_TOTAL; + #if HAS_PREHEAT + case Preheat1 ... CAT(Preheat, PREHEAT_COUNT): + return PREHEAT_SUBMENU_TOTAL; #endif case Motion: return MOTION_TOTAL; case HomeOffsets: return HOMEOFFSETS_TOTAL; @@ -4118,7 +3808,11 @@ uint8_t CrealityDWINClass::Get_Menu_Size(uint8_t menu) { case LevelManual: return LEVELING_M_TOTAL; #endif case Tune: return TUNE_TOTAL; - case PreheatHotend: return PREHEATHOTEND_TOTAL; + + #if HAS_PREHEAT && HAS_HOTEND + case PreheatHotend: return PREHEATHOTEND_TOTAL; + #endif + case ColorSettings: return COLORSETTINGS_TOTAL; } return 0; diff --git a/Marlin/src/lcd/e3v2/jyersui/dwin.h b/Marlin/src/lcd/e3v2/jyersui/dwin.h index 0157f673ce..d238d8e24f 100644 --- a/Marlin/src/lcd/e3v2/jyersui/dwin.h +++ b/Marlin/src/lcd/e3v2/jyersui/dwin.h @@ -60,11 +60,10 @@ enum menuID : uint8_t { PID, HotendPID, BedPID, - Preheat1, - Preheat2, - Preheat3, - Preheat4, - Preheat5, + #if HAS_PREHEAT + #define _PREHEAT_ID(N) Preheat##N, + REPEAT_1(PREHEAT_COUNT, _PREHEAT_ID) + #endif Motion, HomeOffsets, MaxSpeed, diff --git a/Marlin/src/lcd/menu/menu_ubl.cpp b/Marlin/src/lcd/menu/menu_ubl.cpp index c7ffd414cb..d324e057be 100644 --- a/Marlin/src/lcd/menu/menu_ubl.cpp +++ b/Marlin/src/lcd/menu/menu_ubl.cpp @@ -211,26 +211,13 @@ void _lcd_ubl_edit_mesh() { #if HAS_PREHEAT #if HAS_HEATED_BED #define VALIDATE_MESH_GCODE_ITEM(M) \ - GCODES_ITEM_N_S(M, ui.get_preheat_label(M), MSG_UBL_VALIDATE_MESH_M, PSTR("G28\nG26CPI" STRINGIFY(M))) + GCODES_ITEM_N_S(M, ui.get_preheat_label(M), MSG_UBL_VALIDATE_MESH_M, PSTR("G28\nG26CPI" STRINGIFY(M))); #else #define VALIDATE_MESH_GCODE_ITEM(M) \ - GCODES_ITEM_N_S(M, ui.get_preheat_label(M), MSG_UBL_VALIDATE_MESH_M, PSTR("G28\nG26CPB0I" STRINGIFY(M))) + GCODES_ITEM_N_S(M, ui.get_preheat_label(M), MSG_UBL_VALIDATE_MESH_M, PSTR("G28\nG26CPB0I" STRINGIFY(M))); #endif - - VALIDATE_MESH_GCODE_ITEM(0); - #if PREHEAT_COUNT > 1 - VALIDATE_MESH_GCODE_ITEM(1); - #if PREHEAT_COUNT > 2 - VALIDATE_MESH_GCODE_ITEM(2); - #if PREHEAT_COUNT > 3 - VALIDATE_MESH_GCODE_ITEM(3); - #if PREHEAT_COUNT > 4 - VALIDATE_MESH_GCODE_ITEM(4); - #endif - #endif - #endif - #endif - #endif // HAS_PREHEAT + REPEAT(PREHEAT_COUNT, VALIDATE_MESH_GCODE_ITEM) + #endif ACTION_ITEM(MSG_UBL_VALIDATE_CUSTOM_MESH, _lcd_ubl_validate_custom_mesh); ACTION_ITEM(MSG_INFO_SCREEN, ui.return_to_status); END_MENU();