From 94cb412e45b8e719775960312a9241f39e2a5ae2 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 26 Nov 2017 20:53:47 -0600 Subject: [PATCH] Allow override of probe bounds --- Marlin/src/inc/Conditionals_post.h | 38 ++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 90a6b0e2be..3795cdf999 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -957,22 +957,36 @@ // Probing points may be verified at compile time within the radius // using static_assert(HYPOT2(X2-X1,Y2-Y1)<=sq(DELTA_PRINTABLE_RADIUS),"bad probe point!") // so that may be added to SanityCheck.h in the future. - #define MIN_PROBE_X (X_CENTER - DELTA_PRINTABLE_RADIUS) - #define MIN_PROBE_Y (Y_CENTER - DELTA_PRINTABLE_RADIUS) - #define MAX_PROBE_X (X_CENTER + DELTA_PRINTABLE_RADIUS) - #define MAX_PROBE_Y (Y_CENTER + DELTA_PRINTABLE_RADIUS) + #define _MIN_PROBE_X (X_CENTER - DELTA_PRINTABLE_RADIUS) + #define _MIN_PROBE_Y (Y_CENTER - DELTA_PRINTABLE_RADIUS) + #define _MAX_PROBE_X (X_CENTER + DELTA_PRINTABLE_RADIUS) + #define _MAX_PROBE_Y (Y_CENTER + DELTA_PRINTABLE_RADIUS) #elif IS_SCARA #define SCARA_PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2) - #define MIN_PROBE_X (X_CENTER - (SCARA_PRINTABLE_RADIUS)) - #define MIN_PROBE_Y (Y_CENTER - (SCARA_PRINTABLE_RADIUS)) - #define MAX_PROBE_X (X_CENTER + SCARA_PRINTABLE_RADIUS) - #define MAX_PROBE_Y (Y_CENTER + SCARA_PRINTABLE_RADIUS) + #define _MIN_PROBE_X (X_CENTER - (SCARA_PRINTABLE_RADIUS)) + #define _MIN_PROBE_Y (Y_CENTER - (SCARA_PRINTABLE_RADIUS)) + #define _MAX_PROBE_X (X_CENTER + SCARA_PRINTABLE_RADIUS) + #define _MAX_PROBE_Y (Y_CENTER + SCARA_PRINTABLE_RADIUS) #else // Boundaries for Cartesian probing based on bed limits - #define MIN_PROBE_X (max(X_MIN_BED, X_MIN_POS + X_PROBE_OFFSET_FROM_EXTRUDER)) - #define MIN_PROBE_Y (max(Y_MIN_BED, Y_MIN_POS + Y_PROBE_OFFSET_FROM_EXTRUDER)) - #define MAX_PROBE_X (min(X_MAX_BED, X_MAX_POS + X_PROBE_OFFSET_FROM_EXTRUDER)) - #define MAX_PROBE_Y (min(Y_MAX_BED, Y_MAX_POS + Y_PROBE_OFFSET_FROM_EXTRUDER)) + #define _MIN_PROBE_X (max(X_MIN_BED, X_MIN_POS + X_PROBE_OFFSET_FROM_EXTRUDER)) + #define _MIN_PROBE_Y (max(Y_MIN_BED, Y_MIN_POS + Y_PROBE_OFFSET_FROM_EXTRUDER)) + #define _MAX_PROBE_X (min(X_MAX_BED, X_MAX_POS + X_PROBE_OFFSET_FROM_EXTRUDER)) + #define _MAX_PROBE_Y (min(Y_MAX_BED, Y_MAX_POS + Y_PROBE_OFFSET_FROM_EXTRUDER)) +#endif + +// Allow configuration to override these for special purposes +#ifndef MIN_PROBE_X + #define MIN_PROBE_X _MIN_PROBE_X +#endif +#ifndef MIN_PROBE_Y + #define MIN_PROBE_Y _MIN_PROBE_Y +#endif +#ifndef MAX_PROBE_X + #define MAX_PROBE_X _MAX_PROBE_X +#endif +#ifndef MAX_PROBE_Y + #define MAX_PROBE_Y _MAX_PROBE_Y #endif /**