From 01e58de31a804731d21c491952afd2347fda3753 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 10 Jan 2023 22:38:08 -0600 Subject: [PATCH] =?UTF-8?q?=F0=9F=A9=B9=20ProUI=20-=20Remove=20ManualZOffs?= =?UTF-8?q?et?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/inc/Conditionals_LCD.h | 1 + Marlin/src/inc/Conditionals_adv.h | 3 +++ Marlin/src/inc/SanityCheck.h | 20 +++++++++++--------- Marlin/src/lcd/e3v2/proui/dwin.cpp | 19 ++++--------------- Marlin/src/lcd/e3v2/proui/dwin.h | 12 ++++++++---- Marlin/src/lcd/menu/menu_bed_leveling.cpp | 10 ++++++---- Marlin/src/module/probe.h | 8 +++----- 7 files changed, 36 insertions(+), 37 deletions(-) diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 5463e9169c..88d7c91c6e 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -1298,6 +1298,7 @@ // Clear probe pin settings when no probe is selected #undef Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN #undef USE_PROBE_FOR_Z_HOMING + #undef Z_MIN_PROBE_REPEATABILITY_TEST #endif #if ENABLED(BELTPRINTER) && !defined(HOME_Y_BEFORE_X) diff --git a/Marlin/src/inc/Conditionals_adv.h b/Marlin/src/inc/Conditionals_adv.h index bf1088afc8..ea52c9b998 100644 --- a/Marlin/src/inc/Conditionals_adv.h +++ b/Marlin/src/inc/Conditionals_adv.h @@ -79,6 +79,9 @@ #define SERVO_DELAY { 50 } #endif +#if !HAS_BED_PROBE + #undef BABYSTEP_ZPROBE_OFFSET +#endif #if !HAS_STOWABLE_PROBE #undef PROBE_DEPLOY_STOW_MENU #endif diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 6cad2e3c72..5eb057e664 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -1938,15 +1938,17 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS * Make sure Z raise values are set */ #ifndef Z_CLEARANCE_DEPLOY_PROBE - #error "You must define Z_CLEARANCE_DEPLOY_PROBE in your configuration." - #elif !defined(Z_CLEARANCE_BETWEEN_PROBES) - #error "You must define Z_CLEARANCE_BETWEEN_PROBES in your configuration." - #elif Z_CLEARANCE_DEPLOY_PROBE < 0 - #error "Probes need Z_CLEARANCE_DEPLOY_PROBE >= 0." - #elif Z_CLEARANCE_BETWEEN_PROBES < 0 - #error "Probes need Z_CLEARANCE_BETWEEN_PROBES >= 0." - #elif Z_AFTER_PROBING < 0 - #error "Probes need Z_AFTER_PROBING >= 0." + #error "Z_CLEARANCE_DEPLOY_PROBE is required for bed probes." + #else + static_assert(Z_CLEARANCE_DEPLOY_PROBE >= 0, "Probes require Z_CLEARANCE_DEPLOY_PROBE >= 0."); + #endif + #ifndef Z_CLEARANCE_BETWEEN_PROBES + #error "Z_CLEARANCE_BETWEEN_PROBES is required for bed probes." + #else + static_assert(Z_CLEARANCE_BETWEEN_PROBES >= 0, "Probes require Z_CLEARANCE_BETWEEN_PROBES >= 0."); + #endif + #ifdef Z_AFTER_PROBING + static_assert(Z_AFTER_PROBING >= 0, "Probes require Z_AFTER_PROBING >= 0."); #endif #if MULTIPLE_PROBING > 0 || EXTRA_PROBING > 0 diff --git a/Marlin/src/lcd/e3v2/proui/dwin.cpp b/Marlin/src/lcd/e3v2/proui/dwin.cpp index deefbf2573..098db27b1b 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin.cpp @@ -109,14 +109,8 @@ #include "../../../feature/bltouch.h" #endif -#if EITHER(BABYSTEPPING, HAS_BED_PROBE) - #define HAS_ZOFFSET_ITEM 1 - #if ENABLED(BABYSTEPPING) - #include "../../../feature/babystep.h" - #if !HAS_BED_PROBE - #define JUST_BABYSTEP 1 - #endif - #endif +#if ENABLED(BABYSTEPPING) + #include "../../../feature/babystep.h" #endif #if ENABLED(POWER_LOSS_RECOVERY) @@ -197,8 +191,8 @@ #define DWIN_UPDATE_INTERVAL 1024 #define DWIN_REMAIN_TIME_UPDATE_INTERVAL SEC_TO_MS(20) -#if HAS_MESH - #define BABY_Z_VAR TERN(HAS_BED_PROBE, probe.offset.z, HMI_data.ManualZOffset) +#if HAS_MESH && HAS_BED_PROBE + #define BABY_Z_VAR probe.offset.z #else float z_offset = 0; #define BABY_Z_VAR z_offset @@ -1473,10 +1467,6 @@ void DWIN_HomingStart() { void DWIN_HomingDone() { HMI_flag.home_flag = false; - #if DISABLED(HAS_BED_PROBE) && EITHER(BABYSTEP_ZPROBE_OFFSET, JUST_BABYSTEP) - planner.synchronize(); - babystep.add_mm(Z_AXIS, HMI_data.ManualZOffset); - #endif HMI_ReturnScreen(); } @@ -1696,7 +1686,6 @@ void DWIN_SetDataDefaults() { #if BOTH(INDIVIDUAL_AXIS_HOMING_SUBMENU, MESH_BED_LEVELING) HMI_data.z_after_homing = DEF_Z_AFTER_HOMING; #endif - IF_DISABLED(HAS_BED_PROBE, HMI_data.ManualZOffset = 0); #if BOTH(LED_CONTROL_MENU, HAS_COLOR_LEDS) TERN_(LED_COLOR_PRESETS, leds.set_default()); ApplyLEDColor(); diff --git a/Marlin/src/lcd/e3v2/proui/dwin.h b/Marlin/src/lcd/e3v2/proui/dwin.h index 50be4a8ba5..27e1b4ebfa 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.h +++ b/Marlin/src/lcd/e3v2/proui/dwin.h @@ -35,6 +35,13 @@ #include "../common/encoder.h" #include "../../../libs/BL24CXX.h" +#if EITHER(BABYSTEPPING, HAS_BED_PROBE) + #define HAS_ZOFFSET_ITEM 1 + #if !HAS_BED_PROBE + #define JUST_BABYSTEP 1 + #endif +#endif + namespace GET_LANG(LCD_LANGUAGE) { #define _MSG_PREHEAT(N) \ LSTR MSG_PREHEAT_##N = _UxGT("Preheat ") PREHEAT_## N ##_LABEL; \ @@ -118,15 +125,12 @@ typedef struct { #if ENABLED(BAUD_RATE_GCODE) bool Baud115K = false; #endif + bool FullManualTramming = false; bool MediaAutoMount = ENABLED(HAS_SD_EXTENDER); #if BOTH(INDIVIDUAL_AXIS_HOMING_SUBMENU, MESH_BED_LEVELING) uint8_t z_after_homing = DEF_Z_AFTER_HOMING; #endif - #if ENABLED(MESH_BED_LEVELING) - float ManualZOffset = 0; - #endif - // Led #if BOTH(LED_CONTROL_MENU, HAS_COLOR_LEDS) LEDColor Led_Color = Def_Leds_Color; #endif diff --git a/Marlin/src/lcd/menu/menu_bed_leveling.cpp b/Marlin/src/lcd/menu/menu_bed_leveling.cpp index 294666e356..9505a82dd7 100644 --- a/Marlin/src/lcd/menu/menu_bed_leveling.cpp +++ b/Marlin/src/lcd/menu/menu_bed_leveling.cpp @@ -68,10 +68,12 @@ // void _lcd_level_bed_done() { if (!ui.wait_for_move) { - #if Z_AFTER_PROBING > 0 && DISABLED(MESH_BED_LEVELING) - // Display "Done" screen and wait for moves to complete - line_to_z(Z_AFTER_PROBING); - ui.synchronize(GET_TEXT_F(MSG_LEVEL_BED_DONE)); + #if DISABLED(MESH_BED_LEVELING) && defined(Z_AFTER_PROBING) + if (Z_AFTER_PROBING) { + // Display "Done" screen and wait for moves to complete + line_to_z(Z_AFTER_PROBING); + ui.synchronize(GET_TEXT_F(MSG_LEVEL_BED_DONE)); + } #endif ui.goto_previous_screen_no_defer(); ui.completion_feedback(); diff --git a/Marlin/src/module/probe.h b/Marlin/src/module/probe.h index 9290983494..9b28551322 100644 --- a/Marlin/src/module/probe.h +++ b/Marlin/src/module/probe.h @@ -161,11 +161,9 @@ public: #endif static void move_z_after_homing() { - #if ALL(DWIN_LCD_PROUI, INDIVIDUAL_AXIS_HOMING_SUBMENU, MESH_BED_LEVELING) - do_z_clearance(HMI_data.z_after_homing, true); - #elif defined(Z_AFTER_HOMING) - do_z_clearance(Z_AFTER_HOMING, true); - #elif BOTH(Z_AFTER_PROBING, HAS_BED_PROBE) + #if ALL(DWIN_LCD_PROUI, INDIVIDUAL_AXIS_HOMING_SUBMENU, MESH_BED_LEVELING) || defined(Z_AFTER_HOMING) + do_z_clearance(Z_POST_CLEARANCE, true); + #elif HAS_BED_PROBE move_z_after_probing(); #endif }