From 0790a9d5df30f4a6a5990482d78f0b5c85ec9508 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 10 Aug 2024 20:22:47 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20=20Fix=20some=20LCD=20probing=20?= =?UTF-8?q?margins?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/gcode/bedlevel/G26.cpp | 6 +++--- Marlin/src/inc/Conditionals_post.h | 22 +++++++++++++--------- Marlin/src/lcd/e3v2/jyersui/dwin.cpp | 8 ++++---- Marlin/src/lcd/e3v2/proui/dwin.cpp | 8 ++++---- 4 files changed, 24 insertions(+), 20 deletions(-) diff --git a/Marlin/src/gcode/bedlevel/G26.cpp b/Marlin/src/gcode/bedlevel/G26.cpp index 77d625500a..e4272c1a7b 100644 --- a/Marlin/src/gcode/bedlevel/G26.cpp +++ b/Marlin/src/gcode/bedlevel/G26.cpp @@ -132,11 +132,11 @@ #endif #ifndef G26_XY_FEEDRATE - #define G26_XY_FEEDRATE (PLANNER_XY_FEEDRATE() / 3.0) + #define G26_XY_FEEDRATE (PLANNER_XY_FEEDRATE_MM_S / 3.0) #endif #ifndef G26_XY_FEEDRATE_TRAVEL - #define G26_XY_FEEDRATE_TRAVEL (PLANNER_XY_FEEDRATE() / 1.5) + #define G26_XY_FEEDRATE_TRAVEL (PLANNER_XY_FEEDRATE_MM_S / 1.5) #endif #if CROSSHAIRS_SIZE >= INTERSECTION_CIRCLE_RADIUS @@ -783,7 +783,7 @@ void GcodeSuite::G26() { g26.recover_filament(destination); - { REMEMBER(fr, feedrate_mm_s, PLANNER_XY_FEEDRATE() * 0.1f); + { REMEMBER(fr, feedrate_mm_s, PLANNER_XY_FEEDRATE_MM_S * 0.1f); plan_arc(endpoint, arc_offset, false, 0); // Draw a counter-clockwise arc destination = current_position; } diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 02a9f6aff4..56d774f2fc 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -3099,20 +3099,12 @@ * Bed Probing bounds */ -#ifndef PROBING_MARGIN - #define PROBING_MARGIN 0 -#endif - #if IS_KINEMATIC #undef PROBING_MARGIN_LEFT #undef PROBING_MARGIN_RIGHT #undef PROBING_MARGIN_FRONT #undef PROBING_MARGIN_BACK - #define PROBING_MARGIN_LEFT 0 - #define PROBING_MARGIN_RIGHT 0 - #define PROBING_MARGIN_FRONT 0 - #define PROBING_MARGIN_BACK 0 -#else +#elif PROBING_MARGIN #ifndef PROBING_MARGIN_LEFT #define PROBING_MARGIN_LEFT PROBING_MARGIN #endif @@ -3126,6 +3118,18 @@ #define PROBING_MARGIN_BACK PROBING_MARGIN #endif #endif +#ifndef PROBING_MARGIN_LEFT + #define PROBING_MARGIN_LEFT 0 +#endif +#ifndef PROBING_MARGIN_RIGHT + #define PROBING_MARGIN_RIGHT 0 +#endif +#ifndef PROBING_MARGIN_FRONT + #define PROBING_MARGIN_FRONT 0 +#endif +#ifndef PROBING_MARGIN_BACK + #define PROBING_MARGIN_BACK 0 +#endif #if ENABLED(DELTA) /** diff --git a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp index 2edc03dfd6..8e71da82c6 100644 --- a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp @@ -1377,10 +1377,10 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra static bool use_probe = false; #if HAS_BED_PROBE - const float probe_x_min = _MAX(0 + corner_pos, X_MIN_POS + probe.offset.x, X_MIN_POS + PROBING_MARGIN) - probe.offset.x, - probe_x_max = _MIN((X_BED_SIZE + X_MIN_POS) - corner_pos, X_MAX_POS + probe.offset.x, X_MAX_POS - PROBING_MARGIN) - probe.offset.x, - probe_y_min = _MAX(0 + corner_pos, Y_MIN_POS + probe.offset.y, Y_MIN_POS + PROBING_MARGIN) - probe.offset.y, - probe_y_max = _MIN((Y_BED_SIZE + Y_MIN_POS) - corner_pos, Y_MAX_POS + probe.offset.y, Y_MAX_POS - PROBING_MARGIN) - probe.offset.y; + const float probe_x_min = _MAX(0 + corner_pos, X_MIN_POS + probe.offset.x, X_MIN_POS + (PROBING_MARGIN_LEFT)) - probe.offset.x, + probe_x_max = _MIN((X_BED_SIZE + X_MIN_POS) - corner_pos, X_MAX_POS + probe.offset.x, X_MAX_POS - (PROBING_MARGIN_RIGHT)) - probe.offset.x, + probe_y_min = _MAX(0 + corner_pos, Y_MIN_POS + probe.offset.y, Y_MIN_POS + (PROBING_MARGIN_FRONT)) - probe.offset.y, + probe_y_max = _MIN((Y_BED_SIZE + Y_MIN_POS) - corner_pos, Y_MAX_POS + probe.offset.y, Y_MAX_POS - (PROBING_MARGIN_BACK)) - probe.offset.y; #endif switch (item) { diff --git a/Marlin/src/lcd/e3v2/proui/dwin.cpp b/Marlin/src/lcd/e3v2/proui/dwin.cpp index 2b691326c0..1ffc372e58 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin.cpp @@ -2439,16 +2439,16 @@ void setFlow() { setPIntOnClick(FLOW_EDIT_MIN, FLOW_EDIT_MAX, []{ planner.refres else { // AUTO_BED_LEVELING_BILINEAR does not define MESH_INSET #ifndef MESH_MIN_X - #define MESH_MIN_X (_MAX(X_MIN_BED + PROBING_MARGIN, X_MIN_POS)) + #define MESH_MIN_X (_MAX(X_MIN_BED + (PROBING_MARGIN_LEFT), X_MIN_POS)) #endif #ifndef MESH_MIN_Y - #define MESH_MIN_Y (_MAX(Y_MIN_BED + PROBING_MARGIN, Y_MIN_POS)) + #define MESH_MIN_Y (_MAX(Y_MIN_BED + (PROBING_MARGIN_FRONT), Y_MIN_POS)) #endif #ifndef MESH_MAX_X - #define MESH_MAX_X (_MIN(X_MAX_BED - (PROBING_MARGIN), X_MAX_POS)) + #define MESH_MAX_X (_MIN(X_MAX_BED - (PROBING_MARGIN_RIGHT), X_MAX_POS)) #endif #ifndef MESH_MAX_Y - #define MESH_MAX_Y (_MIN(Y_MAX_BED - (PROBING_MARGIN), Y_MAX_POS)) + #define MESH_MAX_Y (_MIN(Y_MAX_BED - (PROBING_MARGIN_BACK), Y_MAX_POS)) #endif LIMIT(xpos, MESH_MIN_X, MESH_MAX_X);