From 67cc29cd3cc08193b98ded764ee19eee6b081b6f Mon Sep 17 00:00:00 2001 From: Thomas Moore Date: Wed, 18 Oct 2017 10:03:30 -0500 Subject: [PATCH 1/5] Update UBL mesh boundaries to accomidate beds centered at 0, 0 (#8012) --- Marlin/Configuration_adv.h | 68 ++++++++++++++++--- Marlin/src/config/default/Configuration_adv.h | 68 ++++++++++++++++--- .../AlephObjects/TAZ4/Configuration_adv.h | 68 ++++++++++++++++--- .../examples/Anet/A6/Configuration_adv.h | 68 ++++++++++++++++--- .../examples/Anet/A8/Configuration_adv.h | 68 ++++++++++++++++--- .../examples/BQ/Hephestos/Configuration_adv.h | 68 ++++++++++++++++--- .../BQ/Hephestos_2/Configuration_adv.h | 68 ++++++++++++++++--- .../examples/BQ/WITBOX/Configuration_adv.h | 68 ++++++++++++++++--- .../examples/Cartesio/Configuration_adv.h | 68 ++++++++++++++++--- .../Creality/CR-10/Configuration_adv.h | 68 ++++++++++++++++--- .../config/examples/Felix/Configuration_adv.h | 68 ++++++++++++++++--- .../Folger Tech/i3-2020/Configuration_adv.h | 68 ++++++++++++++++--- .../Infitary/i3-M508/Configuration_adv.h | 68 ++++++++++++++++--- .../examples/Malyan/M150/Configuration_adv.h | 68 ++++++++++++++++--- .../examples/Mks/Sbase/Configuration_adv.h | 68 ++++++++++++++++--- .../examples/RigidBot/Configuration_adv.h | 68 ++++++++++++++++--- .../config/examples/SCARA/Configuration_adv.h | 68 ++++++++++++++++--- .../examples/Sanguinololu/Configuration_adv.h | 68 ++++++++++++++++--- .../examples/TinyBoy2/Configuration_adv.h | 68 ++++++++++++++++--- .../Velleman/K8200/Configuration_adv.h | 68 ++++++++++++++++--- .../Velleman/K8400/Configuration_adv.h | 68 ++++++++++++++++--- .../FLSUN/auto_calibrate/Configuration_adv.h | 68 ++++++++++++++++--- .../FLSUN/kossel_mini/Configuration_adv.h | 68 ++++++++++++++++--- .../delta/generic/Configuration_adv.h | 68 ++++++++++++++++--- .../delta/kossel_mini/Configuration_adv.h | 68 ++++++++++++++++--- .../delta/kossel_pro/Configuration_adv.h | 68 ++++++++++++++++--- .../delta/kossel_xl/Configuration_adv.h | 68 ++++++++++++++++--- .../gCreate/gMax1.5+/Configuration_adv.h | 68 ++++++++++++++++--- .../examples/makibox/Configuration_adv.h | 68 ++++++++++++++++--- .../tvrrug/Round2/Configuration_adv.h | 68 ++++++++++++++++--- .../config/examples/wt150/Configuration_adv.h | 68 ++++++++++++++++--- 31 files changed, 1860 insertions(+), 248 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 4a86aa8161..25048f304d 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -674,19 +674,71 @@ // @section leveling +#if ENABLED(DELTA) && !defined(DELTA_PROBEABLE_RADIUS) + #define DELTA_PROBEABLE_RADIUS DELTA_PRINTABLE_RADIUS +#elif IS_SCARA && !defined(SCARA_PRINTABLE_RADIUS) + #define SCARA_PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2) +#endif + // Default mesh area is an area with an inset margin on the print area. // Below are the macros that are used to define the borders for the mesh area, // made available here for specialized needs, ie dual extruder setup. #if ENABLED(MESH_BED_LEVELING) - #define MESH_MIN_X MESH_INSET - #define MESH_MAX_X (X_BED_SIZE - (MESH_INSET)) - #define MESH_MIN_Y MESH_INSET - #define MESH_MAX_Y (Y_BED_SIZE - (MESH_INSET)) + #if ENABLED(DELTA) + // 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 MESH_MIN_X (X_CENTER - (DELTA_PROBEABLE_RADIUS) + MESH_INSET) + #define MESH_MIN_Y (Y_CENTER - (DELTA_PROBEABLE_RADIUS) + MESH_INSET) + #define MESH_MAX_X (X_CENTER + DELTA_PROBEABLE_RADIUS - (MESH_INSET)) + #define MESH_MAX_Y (Y_CENTER + DELTA_PROBEABLE_RADIUS - (MESH_INSET)) + #elif IS_SCARA + #define MESH_MIN_X (X_CENTER - (SCARA_PRINTABLE_RADIUS) + MESH_INSET) + #define MESH_MIN_Y (Y_CENTER - (SCARA_PRINTABLE_RADIUS) + MESH_INSET) + #define MESH_MAX_X (X_CENTER + SCARA_PRINTABLE_RADIUS - (MESH_INSET)) + #define MESH_MAX_Y (Y_CENTER + SCARA_PRINTABLE_RADIUS - (MESH_INSET)) + #else + // Boundaries for Cartesian probing based on set limits + #if ENABLED(BED_CENTER_AT_0_0) + #define MESH_MIN_X (max(MESH_INSET, 0) - (X_BED_SIZE) / 2) + #define MESH_MIN_Y (max(MESH_INSET, 0) - (Y_BED_SIZE) / 2) + #define MESH_MAX_X (min(X_BED_SIZE - (MESH_INSET), X_BED_SIZE) - (X_BED_SIZE) / 2) + #define MESH_MAX_Y (min(Y_BED_SIZE - (MESH_INSET), Y_BED_SIZE) - (Y_BED_SIZE) / 2) + #else + #define MESH_MIN_X (max(X_MIN_POS + MESH_INSET, 0)) + #define MESH_MIN_Y (max(Y_MIN_POS + MESH_INSET, 0)) + #define MESH_MAX_X (min(X_MAX_POS - (MESH_INSET), X_BED_SIZE)) + #define MESH_MAX_Y (min(Y_MAX_POS - (MESH_INSET), Y_BED_SIZE)) + #endif + #endif #elif ENABLED(AUTO_BED_LEVELING_UBL) - #define UBL_MESH_MIN_X UBL_MESH_INSET - #define UBL_MESH_MAX_X (X_BED_SIZE - (UBL_MESH_INSET)) - #define UBL_MESH_MIN_Y UBL_MESH_INSET - #define UBL_MESH_MAX_Y (Y_BED_SIZE - (UBL_MESH_INSET)) + #if ENABLED(DELTA) + // 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 UBL_MESH_MIN_X (X_CENTER - (DELTA_PROBEABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MIN_Y (Y_CENTER - (DELTA_PROBEABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MAX_X (X_CENTER + DELTA_PROBEABLE_RADIUS - (UBL_MESH_INSET)) + #define UBL_MESH_MAX_Y (Y_CENTER + DELTA_PROBEABLE_RADIUS - (UBL_MESH_INSET)) + #elif IS_SCARA + #define UBL_MESH_MIN_X (X_CENTER - (SCARA_PRINTABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MIN_Y (Y_CENTER - (SCARA_PRINTABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MAX_X (X_CENTER + SCARA_PRINTABLE_RADIUS - (UBL_MESH_INSET)) + #define UBL_MESH_MAX_Y (Y_CENTER + SCARA_PRINTABLE_RADIUS - (UBL_MESH_INSET)) + #else + // Boundaries for Cartesian probing based on set limits + #if ENABLED(BED_CENTER_AT_0_0) + #define UBL_MESH_MIN_X (max(UBL_MESH_INSET, 0) - (X_BED_SIZE) / 2) + #define UBL_MESH_MIN_Y (max(UBL_MESH_INSET, 0) - (Y_BED_SIZE) / 2) + #define UBL_MESH_MAX_X (min(X_BED_SIZE - (UBL_MESH_INSET), X_BED_SIZE) - (X_BED_SIZE) / 2) + #define UBL_MESH_MAX_Y (min(Y_BED_SIZE - (UBL_MESH_INSET), Y_BED_SIZE) - (Y_BED_SIZE) / 2) + #else + #define UBL_MESH_MIN_X (max(X_MIN_POS + UBL_MESH_INSET, 0)) + #define UBL_MESH_MIN_Y (max(Y_MIN_POS + UBL_MESH_INSET, 0)) + #define UBL_MESH_MAX_X (min(X_MAX_POS - (UBL_MESH_INSET), X_BED_SIZE)) + #define UBL_MESH_MAX_Y (min(Y_MAX_POS - (UBL_MESH_INSET), Y_BED_SIZE)) + #endif + #endif // If this is defined, the currently active mesh will be saved in the // current slot on M500. diff --git a/Marlin/src/config/default/Configuration_adv.h b/Marlin/src/config/default/Configuration_adv.h index 4a86aa8161..25048f304d 100644 --- a/Marlin/src/config/default/Configuration_adv.h +++ b/Marlin/src/config/default/Configuration_adv.h @@ -674,19 +674,71 @@ // @section leveling +#if ENABLED(DELTA) && !defined(DELTA_PROBEABLE_RADIUS) + #define DELTA_PROBEABLE_RADIUS DELTA_PRINTABLE_RADIUS +#elif IS_SCARA && !defined(SCARA_PRINTABLE_RADIUS) + #define SCARA_PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2) +#endif + // Default mesh area is an area with an inset margin on the print area. // Below are the macros that are used to define the borders for the mesh area, // made available here for specialized needs, ie dual extruder setup. #if ENABLED(MESH_BED_LEVELING) - #define MESH_MIN_X MESH_INSET - #define MESH_MAX_X (X_BED_SIZE - (MESH_INSET)) - #define MESH_MIN_Y MESH_INSET - #define MESH_MAX_Y (Y_BED_SIZE - (MESH_INSET)) + #if ENABLED(DELTA) + // 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 MESH_MIN_X (X_CENTER - (DELTA_PROBEABLE_RADIUS) + MESH_INSET) + #define MESH_MIN_Y (Y_CENTER - (DELTA_PROBEABLE_RADIUS) + MESH_INSET) + #define MESH_MAX_X (X_CENTER + DELTA_PROBEABLE_RADIUS - (MESH_INSET)) + #define MESH_MAX_Y (Y_CENTER + DELTA_PROBEABLE_RADIUS - (MESH_INSET)) + #elif IS_SCARA + #define MESH_MIN_X (X_CENTER - (SCARA_PRINTABLE_RADIUS) + MESH_INSET) + #define MESH_MIN_Y (Y_CENTER - (SCARA_PRINTABLE_RADIUS) + MESH_INSET) + #define MESH_MAX_X (X_CENTER + SCARA_PRINTABLE_RADIUS - (MESH_INSET)) + #define MESH_MAX_Y (Y_CENTER + SCARA_PRINTABLE_RADIUS - (MESH_INSET)) + #else + // Boundaries for Cartesian probing based on set limits + #if ENABLED(BED_CENTER_AT_0_0) + #define MESH_MIN_X (max(MESH_INSET, 0) - (X_BED_SIZE) / 2) + #define MESH_MIN_Y (max(MESH_INSET, 0) - (Y_BED_SIZE) / 2) + #define MESH_MAX_X (min(X_BED_SIZE - (MESH_INSET), X_BED_SIZE) - (X_BED_SIZE) / 2) + #define MESH_MAX_Y (min(Y_BED_SIZE - (MESH_INSET), Y_BED_SIZE) - (Y_BED_SIZE) / 2) + #else + #define MESH_MIN_X (max(X_MIN_POS + MESH_INSET, 0)) + #define MESH_MIN_Y (max(Y_MIN_POS + MESH_INSET, 0)) + #define MESH_MAX_X (min(X_MAX_POS - (MESH_INSET), X_BED_SIZE)) + #define MESH_MAX_Y (min(Y_MAX_POS - (MESH_INSET), Y_BED_SIZE)) + #endif + #endif #elif ENABLED(AUTO_BED_LEVELING_UBL) - #define UBL_MESH_MIN_X UBL_MESH_INSET - #define UBL_MESH_MAX_X (X_BED_SIZE - (UBL_MESH_INSET)) - #define UBL_MESH_MIN_Y UBL_MESH_INSET - #define UBL_MESH_MAX_Y (Y_BED_SIZE - (UBL_MESH_INSET)) + #if ENABLED(DELTA) + // 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 UBL_MESH_MIN_X (X_CENTER - (DELTA_PROBEABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MIN_Y (Y_CENTER - (DELTA_PROBEABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MAX_X (X_CENTER + DELTA_PROBEABLE_RADIUS - (UBL_MESH_INSET)) + #define UBL_MESH_MAX_Y (Y_CENTER + DELTA_PROBEABLE_RADIUS - (UBL_MESH_INSET)) + #elif IS_SCARA + #define UBL_MESH_MIN_X (X_CENTER - (SCARA_PRINTABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MIN_Y (Y_CENTER - (SCARA_PRINTABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MAX_X (X_CENTER + SCARA_PRINTABLE_RADIUS - (UBL_MESH_INSET)) + #define UBL_MESH_MAX_Y (Y_CENTER + SCARA_PRINTABLE_RADIUS - (UBL_MESH_INSET)) + #else + // Boundaries for Cartesian probing based on set limits + #if ENABLED(BED_CENTER_AT_0_0) + #define UBL_MESH_MIN_X (max(UBL_MESH_INSET, 0) - (X_BED_SIZE) / 2) + #define UBL_MESH_MIN_Y (max(UBL_MESH_INSET, 0) - (Y_BED_SIZE) / 2) + #define UBL_MESH_MAX_X (min(X_BED_SIZE - (UBL_MESH_INSET), X_BED_SIZE) - (X_BED_SIZE) / 2) + #define UBL_MESH_MAX_Y (min(Y_BED_SIZE - (UBL_MESH_INSET), Y_BED_SIZE) - (Y_BED_SIZE) / 2) + #else + #define UBL_MESH_MIN_X (max(X_MIN_POS + UBL_MESH_INSET, 0)) + #define UBL_MESH_MIN_Y (max(Y_MIN_POS + UBL_MESH_INSET, 0)) + #define UBL_MESH_MAX_X (min(X_MAX_POS - (UBL_MESH_INSET), X_BED_SIZE)) + #define UBL_MESH_MAX_Y (min(Y_MAX_POS - (UBL_MESH_INSET), Y_BED_SIZE)) + #endif + #endif // If this is defined, the currently active mesh will be saved in the // current slot on M500. diff --git a/Marlin/src/config/examples/AlephObjects/TAZ4/Configuration_adv.h b/Marlin/src/config/examples/AlephObjects/TAZ4/Configuration_adv.h index 2641a47edc..bdca7c3bd9 100644 --- a/Marlin/src/config/examples/AlephObjects/TAZ4/Configuration_adv.h +++ b/Marlin/src/config/examples/AlephObjects/TAZ4/Configuration_adv.h @@ -673,19 +673,71 @@ // @section leveling +#if ENABLED(DELTA) && !defined(DELTA_PROBEABLE_RADIUS) + #define DELTA_PROBEABLE_RADIUS DELTA_PRINTABLE_RADIUS +#elif IS_SCARA && !defined(SCARA_PRINTABLE_RADIUS) + #define SCARA_PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2) +#endif + // Default mesh area is an area with an inset margin on the print area. // Below are the macros that are used to define the borders for the mesh area, // made available here for specialized needs, ie dual extruder setup. #if ENABLED(MESH_BED_LEVELING) - #define MESH_MIN_X MESH_INSET - #define MESH_MAX_X (X_BED_SIZE - (MESH_INSET)) - #define MESH_MIN_Y MESH_INSET - #define MESH_MAX_Y (Y_BED_SIZE - (MESH_INSET)) + #if ENABLED(DELTA) + // 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 MESH_MIN_X (X_CENTER - (DELTA_PROBEABLE_RADIUS) + MESH_INSET) + #define MESH_MIN_Y (Y_CENTER - (DELTA_PROBEABLE_RADIUS) + MESH_INSET) + #define MESH_MAX_X (X_CENTER + DELTA_PROBEABLE_RADIUS - (MESH_INSET)) + #define MESH_MAX_Y (Y_CENTER + DELTA_PROBEABLE_RADIUS - (MESH_INSET)) + #elif IS_SCARA + #define MESH_MIN_X (X_CENTER - (SCARA_PRINTABLE_RADIUS) + MESH_INSET) + #define MESH_MIN_Y (Y_CENTER - (SCARA_PRINTABLE_RADIUS) + MESH_INSET) + #define MESH_MAX_X (X_CENTER + SCARA_PRINTABLE_RADIUS - (MESH_INSET)) + #define MESH_MAX_Y (Y_CENTER + SCARA_PRINTABLE_RADIUS - (MESH_INSET)) + #else + // Boundaries for Cartesian probing based on set limits + #if ENABLED(BED_CENTER_AT_0_0) + #define MESH_MIN_X (max(MESH_INSET, 0) - (X_BED_SIZE) / 2) + #define MESH_MIN_Y (max(MESH_INSET, 0) - (Y_BED_SIZE) / 2) + #define MESH_MAX_X (min(X_BED_SIZE - (MESH_INSET), X_BED_SIZE) - (X_BED_SIZE) / 2) + #define MESH_MAX_Y (min(Y_BED_SIZE - (MESH_INSET), Y_BED_SIZE) - (Y_BED_SIZE) / 2) + #else + #define MESH_MIN_X (max(X_MIN_POS + MESH_INSET, 0)) + #define MESH_MIN_Y (max(Y_MIN_POS + MESH_INSET, 0)) + #define MESH_MAX_X (min(X_MAX_POS - (MESH_INSET), X_BED_SIZE)) + #define MESH_MAX_Y (min(Y_MAX_POS - (MESH_INSET), Y_BED_SIZE)) + #endif + #endif #elif ENABLED(AUTO_BED_LEVELING_UBL) - #define UBL_MESH_MIN_X UBL_MESH_INSET - #define UBL_MESH_MAX_X (X_BED_SIZE - (UBL_MESH_INSET)) - #define UBL_MESH_MIN_Y UBL_MESH_INSET - #define UBL_MESH_MAX_Y (Y_BED_SIZE - (UBL_MESH_INSET)) + #if ENABLED(DELTA) + // 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 UBL_MESH_MIN_X (X_CENTER - (DELTA_PROBEABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MIN_Y (Y_CENTER - (DELTA_PROBEABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MAX_X (X_CENTER + DELTA_PROBEABLE_RADIUS - (UBL_MESH_INSET)) + #define UBL_MESH_MAX_Y (Y_CENTER + DELTA_PROBEABLE_RADIUS - (UBL_MESH_INSET)) + #elif IS_SCARA + #define UBL_MESH_MIN_X (X_CENTER - (SCARA_PRINTABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MIN_Y (Y_CENTER - (SCARA_PRINTABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MAX_X (X_CENTER + SCARA_PRINTABLE_RADIUS - (UBL_MESH_INSET)) + #define UBL_MESH_MAX_Y (Y_CENTER + SCARA_PRINTABLE_RADIUS - (UBL_MESH_INSET)) + #else + // Boundaries for Cartesian probing based on set limits + #if ENABLED(BED_CENTER_AT_0_0) + #define UBL_MESH_MIN_X (max(UBL_MESH_INSET, 0) - (X_BED_SIZE) / 2) + #define UBL_MESH_MIN_Y (max(UBL_MESH_INSET, 0) - (Y_BED_SIZE) / 2) + #define UBL_MESH_MAX_X (min(X_BED_SIZE - (UBL_MESH_INSET), X_BED_SIZE) - (X_BED_SIZE) / 2) + #define UBL_MESH_MAX_Y (min(Y_BED_SIZE - (UBL_MESH_INSET), Y_BED_SIZE) - (Y_BED_SIZE) / 2) + #else + #define UBL_MESH_MIN_X (max(X_MIN_POS + UBL_MESH_INSET, 0)) + #define UBL_MESH_MIN_Y (max(Y_MIN_POS + UBL_MESH_INSET, 0)) + #define UBL_MESH_MAX_X (min(X_MAX_POS - (UBL_MESH_INSET), X_BED_SIZE)) + #define UBL_MESH_MAX_Y (min(Y_MAX_POS - (UBL_MESH_INSET), Y_BED_SIZE)) + #endif + #endif // If this is defined, the currently active mesh will be saved in the // current slot on M500. diff --git a/Marlin/src/config/examples/Anet/A6/Configuration_adv.h b/Marlin/src/config/examples/Anet/A6/Configuration_adv.h index d46d024279..f1e61eb7cd 100644 --- a/Marlin/src/config/examples/Anet/A6/Configuration_adv.h +++ b/Marlin/src/config/examples/Anet/A6/Configuration_adv.h @@ -673,19 +673,71 @@ // @section leveling +#if ENABLED(DELTA) && !defined(DELTA_PROBEABLE_RADIUS) + #define DELTA_PROBEABLE_RADIUS DELTA_PRINTABLE_RADIUS +#elif IS_SCARA && !defined(SCARA_PRINTABLE_RADIUS) + #define SCARA_PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2) +#endif + // Default mesh area is an area with an inset margin on the print area. // Below are the macros that are used to define the borders for the mesh area, // made available here for specialized needs, ie dual extruder setup. #if ENABLED(MESH_BED_LEVELING) - #define MESH_MIN_X MESH_INSET - #define MESH_MAX_X (X_BED_SIZE - (MESH_INSET)) - #define MESH_MIN_Y MESH_INSET - #define MESH_MAX_Y (Y_BED_SIZE - (MESH_INSET)) + #if ENABLED(DELTA) + // 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 MESH_MIN_X (X_CENTER - (DELTA_PROBEABLE_RADIUS) + MESH_INSET) + #define MESH_MIN_Y (Y_CENTER - (DELTA_PROBEABLE_RADIUS) + MESH_INSET) + #define MESH_MAX_X (X_CENTER + DELTA_PROBEABLE_RADIUS - (MESH_INSET)) + #define MESH_MAX_Y (Y_CENTER + DELTA_PROBEABLE_RADIUS - (MESH_INSET)) + #elif IS_SCARA + #define MESH_MIN_X (X_CENTER - (SCARA_PRINTABLE_RADIUS) + MESH_INSET) + #define MESH_MIN_Y (Y_CENTER - (SCARA_PRINTABLE_RADIUS) + MESH_INSET) + #define MESH_MAX_X (X_CENTER + SCARA_PRINTABLE_RADIUS - (MESH_INSET)) + #define MESH_MAX_Y (Y_CENTER + SCARA_PRINTABLE_RADIUS - (MESH_INSET)) + #else + // Boundaries for Cartesian probing based on set limits + #if ENABLED(BED_CENTER_AT_0_0) + #define MESH_MIN_X (max(MESH_INSET, 0) - (X_BED_SIZE) / 2) + #define MESH_MIN_Y (max(MESH_INSET, 0) - (Y_BED_SIZE) / 2) + #define MESH_MAX_X (min(X_BED_SIZE - (MESH_INSET), X_BED_SIZE) - (X_BED_SIZE) / 2) + #define MESH_MAX_Y (min(Y_BED_SIZE - (MESH_INSET), Y_BED_SIZE) - (Y_BED_SIZE) / 2) + #else + #define MESH_MIN_X (max(X_MIN_POS + MESH_INSET, 0)) + #define MESH_MIN_Y (max(Y_MIN_POS + MESH_INSET, 0)) + #define MESH_MAX_X (min(X_MAX_POS - (MESH_INSET), X_BED_SIZE)) + #define MESH_MAX_Y (min(Y_MAX_POS - (MESH_INSET), Y_BED_SIZE)) + #endif + #endif #elif ENABLED(AUTO_BED_LEVELING_UBL) - #define UBL_MESH_MIN_X UBL_MESH_INSET - #define UBL_MESH_MAX_X (X_BED_SIZE - (UBL_MESH_INSET)) - #define UBL_MESH_MIN_Y UBL_MESH_INSET - #define UBL_MESH_MAX_Y (Y_BED_SIZE - (UBL_MESH_INSET)) + #if ENABLED(DELTA) + // 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 UBL_MESH_MIN_X (X_CENTER - (DELTA_PROBEABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MIN_Y (Y_CENTER - (DELTA_PROBEABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MAX_X (X_CENTER + DELTA_PROBEABLE_RADIUS - (UBL_MESH_INSET)) + #define UBL_MESH_MAX_Y (Y_CENTER + DELTA_PROBEABLE_RADIUS - (UBL_MESH_INSET)) + #elif IS_SCARA + #define UBL_MESH_MIN_X (X_CENTER - (SCARA_PRINTABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MIN_Y (Y_CENTER - (SCARA_PRINTABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MAX_X (X_CENTER + SCARA_PRINTABLE_RADIUS - (UBL_MESH_INSET)) + #define UBL_MESH_MAX_Y (Y_CENTER + SCARA_PRINTABLE_RADIUS - (UBL_MESH_INSET)) + #else + // Boundaries for Cartesian probing based on set limits + #if ENABLED(BED_CENTER_AT_0_0) + #define UBL_MESH_MIN_X (max(UBL_MESH_INSET, 0) - (X_BED_SIZE) / 2) + #define UBL_MESH_MIN_Y (max(UBL_MESH_INSET, 0) - (Y_BED_SIZE) / 2) + #define UBL_MESH_MAX_X (min(X_BED_SIZE - (UBL_MESH_INSET), X_BED_SIZE) - (X_BED_SIZE) / 2) + #define UBL_MESH_MAX_Y (min(Y_BED_SIZE - (UBL_MESH_INSET), Y_BED_SIZE) - (Y_BED_SIZE) / 2) + #else + #define UBL_MESH_MIN_X (max(X_MIN_POS + UBL_MESH_INSET, 0)) + #define UBL_MESH_MIN_Y (max(Y_MIN_POS + UBL_MESH_INSET, 0)) + #define UBL_MESH_MAX_X (min(X_MAX_POS - (UBL_MESH_INSET), X_BED_SIZE)) + #define UBL_MESH_MAX_Y (min(Y_MAX_POS - (UBL_MESH_INSET), Y_BED_SIZE)) + #endif + #endif // If this is defined, the currently active mesh will be saved in the // current slot on M500. diff --git a/Marlin/src/config/examples/Anet/A8/Configuration_adv.h b/Marlin/src/config/examples/Anet/A8/Configuration_adv.h index 2d49bf9357..6f84d700c1 100644 --- a/Marlin/src/config/examples/Anet/A8/Configuration_adv.h +++ b/Marlin/src/config/examples/Anet/A8/Configuration_adv.h @@ -673,19 +673,71 @@ // @section leveling +#if ENABLED(DELTA) && !defined(DELTA_PROBEABLE_RADIUS) + #define DELTA_PROBEABLE_RADIUS DELTA_PRINTABLE_RADIUS +#elif IS_SCARA && !defined(SCARA_PRINTABLE_RADIUS) + #define SCARA_PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2) +#endif + // Default mesh area is an area with an inset margin on the print area. // Below are the macros that are used to define the borders for the mesh area, // made available here for specialized needs, ie dual extruder setup. #if ENABLED(MESH_BED_LEVELING) - #define MESH_MIN_X MESH_INSET - #define MESH_MAX_X (X_BED_SIZE - (MESH_INSET)) - #define MESH_MIN_Y MESH_INSET - #define MESH_MAX_Y (Y_BED_SIZE - (MESH_INSET)) + #if ENABLED(DELTA) + // 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 MESH_MIN_X (X_CENTER - (DELTA_PROBEABLE_RADIUS) + MESH_INSET) + #define MESH_MIN_Y (Y_CENTER - (DELTA_PROBEABLE_RADIUS) + MESH_INSET) + #define MESH_MAX_X (X_CENTER + DELTA_PROBEABLE_RADIUS - (MESH_INSET)) + #define MESH_MAX_Y (Y_CENTER + DELTA_PROBEABLE_RADIUS - (MESH_INSET)) + #elif IS_SCARA + #define MESH_MIN_X (X_CENTER - (SCARA_PRINTABLE_RADIUS) + MESH_INSET) + #define MESH_MIN_Y (Y_CENTER - (SCARA_PRINTABLE_RADIUS) + MESH_INSET) + #define MESH_MAX_X (X_CENTER + SCARA_PRINTABLE_RADIUS - (MESH_INSET)) + #define MESH_MAX_Y (Y_CENTER + SCARA_PRINTABLE_RADIUS - (MESH_INSET)) + #else + // Boundaries for Cartesian probing based on set limits + #if ENABLED(BED_CENTER_AT_0_0) + #define MESH_MIN_X (max(MESH_INSET, 0) - (X_BED_SIZE) / 2) + #define MESH_MIN_Y (max(MESH_INSET, 0) - (Y_BED_SIZE) / 2) + #define MESH_MAX_X (min(X_BED_SIZE - (MESH_INSET), X_BED_SIZE) - (X_BED_SIZE) / 2) + #define MESH_MAX_Y (min(Y_BED_SIZE - (MESH_INSET), Y_BED_SIZE) - (Y_BED_SIZE) / 2) + #else + #define MESH_MIN_X (max(X_MIN_POS + MESH_INSET, 0)) + #define MESH_MIN_Y (max(Y_MIN_POS + MESH_INSET, 0)) + #define MESH_MAX_X (min(X_MAX_POS - (MESH_INSET), X_BED_SIZE)) + #define MESH_MAX_Y (min(Y_MAX_POS - (MESH_INSET), Y_BED_SIZE)) + #endif + #endif #elif ENABLED(AUTO_BED_LEVELING_UBL) - #define UBL_MESH_MIN_X UBL_MESH_INSET - #define UBL_MESH_MAX_X (X_BED_SIZE - (UBL_MESH_INSET)) - #define UBL_MESH_MIN_Y UBL_MESH_INSET - #define UBL_MESH_MAX_Y (Y_BED_SIZE - (UBL_MESH_INSET)) + #if ENABLED(DELTA) + // 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 UBL_MESH_MIN_X (X_CENTER - (DELTA_PROBEABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MIN_Y (Y_CENTER - (DELTA_PROBEABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MAX_X (X_CENTER + DELTA_PROBEABLE_RADIUS - (UBL_MESH_INSET)) + #define UBL_MESH_MAX_Y (Y_CENTER + DELTA_PROBEABLE_RADIUS - (UBL_MESH_INSET)) + #elif IS_SCARA + #define UBL_MESH_MIN_X (X_CENTER - (SCARA_PRINTABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MIN_Y (Y_CENTER - (SCARA_PRINTABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MAX_X (X_CENTER + SCARA_PRINTABLE_RADIUS - (UBL_MESH_INSET)) + #define UBL_MESH_MAX_Y (Y_CENTER + SCARA_PRINTABLE_RADIUS - (UBL_MESH_INSET)) + #else + // Boundaries for Cartesian probing based on set limits + #if ENABLED(BED_CENTER_AT_0_0) + #define UBL_MESH_MIN_X (max(UBL_MESH_INSET, 0) - (X_BED_SIZE) / 2) + #define UBL_MESH_MIN_Y (max(UBL_MESH_INSET, 0) - (Y_BED_SIZE) / 2) + #define UBL_MESH_MAX_X (min(X_BED_SIZE - (UBL_MESH_INSET), X_BED_SIZE) - (X_BED_SIZE) / 2) + #define UBL_MESH_MAX_Y (min(Y_BED_SIZE - (UBL_MESH_INSET), Y_BED_SIZE) - (Y_BED_SIZE) / 2) + #else + #define UBL_MESH_MIN_X (max(X_MIN_POS + UBL_MESH_INSET, 0)) + #define UBL_MESH_MIN_Y (max(Y_MIN_POS + UBL_MESH_INSET, 0)) + #define UBL_MESH_MAX_X (min(X_MAX_POS - (UBL_MESH_INSET), X_BED_SIZE)) + #define UBL_MESH_MAX_Y (min(Y_MAX_POS - (UBL_MESH_INSET), Y_BED_SIZE)) + #endif + #endif // If this is defined, the currently active mesh will be saved in the // current slot on M500. diff --git a/Marlin/src/config/examples/BQ/Hephestos/Configuration_adv.h b/Marlin/src/config/examples/BQ/Hephestos/Configuration_adv.h index 9c83019b55..882995f091 100644 --- a/Marlin/src/config/examples/BQ/Hephestos/Configuration_adv.h +++ b/Marlin/src/config/examples/BQ/Hephestos/Configuration_adv.h @@ -673,19 +673,71 @@ // @section leveling +#if ENABLED(DELTA) && !defined(DELTA_PROBEABLE_RADIUS) + #define DELTA_PROBEABLE_RADIUS DELTA_PRINTABLE_RADIUS +#elif IS_SCARA && !defined(SCARA_PRINTABLE_RADIUS) + #define SCARA_PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2) +#endif + // Default mesh area is an area with an inset margin on the print area. // Below are the macros that are used to define the borders for the mesh area, // made available here for specialized needs, ie dual extruder setup. #if ENABLED(MESH_BED_LEVELING) - #define MESH_MIN_X MESH_INSET - #define MESH_MAX_X (X_BED_SIZE - (MESH_INSET)) - #define MESH_MIN_Y MESH_INSET - #define MESH_MAX_Y (Y_BED_SIZE - (MESH_INSET)) + #if ENABLED(DELTA) + // 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 MESH_MIN_X (X_CENTER - (DELTA_PROBEABLE_RADIUS) + MESH_INSET) + #define MESH_MIN_Y (Y_CENTER - (DELTA_PROBEABLE_RADIUS) + MESH_INSET) + #define MESH_MAX_X (X_CENTER + DELTA_PROBEABLE_RADIUS - (MESH_INSET)) + #define MESH_MAX_Y (Y_CENTER + DELTA_PROBEABLE_RADIUS - (MESH_INSET)) + #elif IS_SCARA + #define MESH_MIN_X (X_CENTER - (SCARA_PRINTABLE_RADIUS) + MESH_INSET) + #define MESH_MIN_Y (Y_CENTER - (SCARA_PRINTABLE_RADIUS) + MESH_INSET) + #define MESH_MAX_X (X_CENTER + SCARA_PRINTABLE_RADIUS - (MESH_INSET)) + #define MESH_MAX_Y (Y_CENTER + SCARA_PRINTABLE_RADIUS - (MESH_INSET)) + #else + // Boundaries for Cartesian probing based on set limits + #if ENABLED(BED_CENTER_AT_0_0) + #define MESH_MIN_X (max(MESH_INSET, 0) - (X_BED_SIZE) / 2) + #define MESH_MIN_Y (max(MESH_INSET, 0) - (Y_BED_SIZE) / 2) + #define MESH_MAX_X (min(X_BED_SIZE - (MESH_INSET), X_BED_SIZE) - (X_BED_SIZE) / 2) + #define MESH_MAX_Y (min(Y_BED_SIZE - (MESH_INSET), Y_BED_SIZE) - (Y_BED_SIZE) / 2) + #else + #define MESH_MIN_X (max(X_MIN_POS + MESH_INSET, 0)) + #define MESH_MIN_Y (max(Y_MIN_POS + MESH_INSET, 0)) + #define MESH_MAX_X (min(X_MAX_POS - (MESH_INSET), X_BED_SIZE)) + #define MESH_MAX_Y (min(Y_MAX_POS - (MESH_INSET), Y_BED_SIZE)) + #endif + #endif #elif ENABLED(AUTO_BED_LEVELING_UBL) - #define UBL_MESH_MIN_X UBL_MESH_INSET - #define UBL_MESH_MAX_X (X_BED_SIZE - (UBL_MESH_INSET)) - #define UBL_MESH_MIN_Y UBL_MESH_INSET - #define UBL_MESH_MAX_Y (Y_BED_SIZE - (UBL_MESH_INSET)) + #if ENABLED(DELTA) + // 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 UBL_MESH_MIN_X (X_CENTER - (DELTA_PROBEABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MIN_Y (Y_CENTER - (DELTA_PROBEABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MAX_X (X_CENTER + DELTA_PROBEABLE_RADIUS - (UBL_MESH_INSET)) + #define UBL_MESH_MAX_Y (Y_CENTER + DELTA_PROBEABLE_RADIUS - (UBL_MESH_INSET)) + #elif IS_SCARA + #define UBL_MESH_MIN_X (X_CENTER - (SCARA_PRINTABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MIN_Y (Y_CENTER - (SCARA_PRINTABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MAX_X (X_CENTER + SCARA_PRINTABLE_RADIUS - (UBL_MESH_INSET)) + #define UBL_MESH_MAX_Y (Y_CENTER + SCARA_PRINTABLE_RADIUS - (UBL_MESH_INSET)) + #else + // Boundaries for Cartesian probing based on set limits + #if ENABLED(BED_CENTER_AT_0_0) + #define UBL_MESH_MIN_X (max(UBL_MESH_INSET, 0) - (X_BED_SIZE) / 2) + #define UBL_MESH_MIN_Y (max(UBL_MESH_INSET, 0) - (Y_BED_SIZE) / 2) + #define UBL_MESH_MAX_X (min(X_BED_SIZE - (UBL_MESH_INSET), X_BED_SIZE) - (X_BED_SIZE) / 2) + #define UBL_MESH_MAX_Y (min(Y_BED_SIZE - (UBL_MESH_INSET), Y_BED_SIZE) - (Y_BED_SIZE) / 2) + #else + #define UBL_MESH_MIN_X (max(X_MIN_POS + UBL_MESH_INSET, 0)) + #define UBL_MESH_MIN_Y (max(Y_MIN_POS + UBL_MESH_INSET, 0)) + #define UBL_MESH_MAX_X (min(X_MAX_POS - (UBL_MESH_INSET), X_BED_SIZE)) + #define UBL_MESH_MAX_Y (min(Y_MAX_POS - (UBL_MESH_INSET), Y_BED_SIZE)) + #endif + #endif // If this is defined, the currently active mesh will be saved in the // current slot on M500. diff --git a/Marlin/src/config/examples/BQ/Hephestos_2/Configuration_adv.h b/Marlin/src/config/examples/BQ/Hephestos_2/Configuration_adv.h index 468b11180e..108d091966 100644 --- a/Marlin/src/config/examples/BQ/Hephestos_2/Configuration_adv.h +++ b/Marlin/src/config/examples/BQ/Hephestos_2/Configuration_adv.h @@ -670,19 +670,71 @@ // @section leveling +#if ENABLED(DELTA) && !defined(DELTA_PROBEABLE_RADIUS) + #define DELTA_PROBEABLE_RADIUS DELTA_PRINTABLE_RADIUS +#elif IS_SCARA && !defined(SCARA_PRINTABLE_RADIUS) + #define SCARA_PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2) +#endif + // Default mesh area is an area with an inset margin on the print area. // Below are the macros that are used to define the borders for the mesh area, // made available here for specialized needs, ie dual extruder setup. #if ENABLED(MESH_BED_LEVELING) - #define MESH_MIN_X MESH_INSET - #define MESH_MAX_X (X_BED_SIZE - (MESH_INSET)) - #define MESH_MIN_Y MESH_INSET - #define MESH_MAX_Y (Y_BED_SIZE - (MESH_INSET)) + #if ENABLED(DELTA) + // 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 MESH_MIN_X (X_CENTER - (DELTA_PROBEABLE_RADIUS) + MESH_INSET) + #define MESH_MIN_Y (Y_CENTER - (DELTA_PROBEABLE_RADIUS) + MESH_INSET) + #define MESH_MAX_X (X_CENTER + DELTA_PROBEABLE_RADIUS - (MESH_INSET)) + #define MESH_MAX_Y (Y_CENTER + DELTA_PROBEABLE_RADIUS - (MESH_INSET)) + #elif IS_SCARA + #define MESH_MIN_X (X_CENTER - (SCARA_PRINTABLE_RADIUS) + MESH_INSET) + #define MESH_MIN_Y (Y_CENTER - (SCARA_PRINTABLE_RADIUS) + MESH_INSET) + #define MESH_MAX_X (X_CENTER + SCARA_PRINTABLE_RADIUS - (MESH_INSET)) + #define MESH_MAX_Y (Y_CENTER + SCARA_PRINTABLE_RADIUS - (MESH_INSET)) + #else + // Boundaries for Cartesian probing based on set limits + #if ENABLED(BED_CENTER_AT_0_0) + #define MESH_MIN_X (max(MESH_INSET, 0) - (X_BED_SIZE) / 2) + #define MESH_MIN_Y (max(MESH_INSET, 0) - (Y_BED_SIZE) / 2) + #define MESH_MAX_X (min(X_BED_SIZE - (MESH_INSET), X_BED_SIZE) - (X_BED_SIZE) / 2) + #define MESH_MAX_Y (min(Y_BED_SIZE - (MESH_INSET), Y_BED_SIZE) - (Y_BED_SIZE) / 2) + #else + #define MESH_MIN_X (max(X_MIN_POS + MESH_INSET, 0)) + #define MESH_MIN_Y (max(Y_MIN_POS + MESH_INSET, 0)) + #define MESH_MAX_X (min(X_MAX_POS - (MESH_INSET), X_BED_SIZE)) + #define MESH_MAX_Y (min(Y_MAX_POS - (MESH_INSET), Y_BED_SIZE)) + #endif + #endif #elif ENABLED(AUTO_BED_LEVELING_UBL) - #define UBL_MESH_MIN_X UBL_MESH_INSET - #define UBL_MESH_MAX_X (X_BED_SIZE - (UBL_MESH_INSET)) - #define UBL_MESH_MIN_Y UBL_MESH_INSET - #define UBL_MESH_MAX_Y (Y_BED_SIZE - (UBL_MESH_INSET)) + #if ENABLED(DELTA) + // 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 UBL_MESH_MIN_X (X_CENTER - (DELTA_PROBEABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MIN_Y (Y_CENTER - (DELTA_PROBEABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MAX_X (X_CENTER + DELTA_PROBEABLE_RADIUS - (UBL_MESH_INSET)) + #define UBL_MESH_MAX_Y (Y_CENTER + DELTA_PROBEABLE_RADIUS - (UBL_MESH_INSET)) + #elif IS_SCARA + #define UBL_MESH_MIN_X (X_CENTER - (SCARA_PRINTABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MIN_Y (Y_CENTER - (SCARA_PRINTABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MAX_X (X_CENTER + SCARA_PRINTABLE_RADIUS - (UBL_MESH_INSET)) + #define UBL_MESH_MAX_Y (Y_CENTER + SCARA_PRINTABLE_RADIUS - (UBL_MESH_INSET)) + #else + // Boundaries for Cartesian probing based on set limits + #if ENABLED(BED_CENTER_AT_0_0) + #define UBL_MESH_MIN_X (max(UBL_MESH_INSET, 0) - (X_BED_SIZE) / 2) + #define UBL_MESH_MIN_Y (max(UBL_MESH_INSET, 0) - (Y_BED_SIZE) / 2) + #define UBL_MESH_MAX_X (min(X_BED_SIZE - (UBL_MESH_INSET), X_BED_SIZE) - (X_BED_SIZE) / 2) + #define UBL_MESH_MAX_Y (min(Y_BED_SIZE - (UBL_MESH_INSET), Y_BED_SIZE) - (Y_BED_SIZE) / 2) + #else + #define UBL_MESH_MIN_X (max(X_MIN_POS + UBL_MESH_INSET, 0)) + #define UBL_MESH_MIN_Y (max(Y_MIN_POS + UBL_MESH_INSET, 0)) + #define UBL_MESH_MAX_X (min(X_MAX_POS - (UBL_MESH_INSET), X_BED_SIZE)) + #define UBL_MESH_MAX_Y (min(Y_MAX_POS - (UBL_MESH_INSET), Y_BED_SIZE)) + #endif + #endif // If this is defined, the currently active mesh will be saved in the // current slot on M500. diff --git a/Marlin/src/config/examples/BQ/WITBOX/Configuration_adv.h b/Marlin/src/config/examples/BQ/WITBOX/Configuration_adv.h index 9c83019b55..882995f091 100644 --- a/Marlin/src/config/examples/BQ/WITBOX/Configuration_adv.h +++ b/Marlin/src/config/examples/BQ/WITBOX/Configuration_adv.h @@ -673,19 +673,71 @@ // @section leveling +#if ENABLED(DELTA) && !defined(DELTA_PROBEABLE_RADIUS) + #define DELTA_PROBEABLE_RADIUS DELTA_PRINTABLE_RADIUS +#elif IS_SCARA && !defined(SCARA_PRINTABLE_RADIUS) + #define SCARA_PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2) +#endif + // Default mesh area is an area with an inset margin on the print area. // Below are the macros that are used to define the borders for the mesh area, // made available here for specialized needs, ie dual extruder setup. #if ENABLED(MESH_BED_LEVELING) - #define MESH_MIN_X MESH_INSET - #define MESH_MAX_X (X_BED_SIZE - (MESH_INSET)) - #define MESH_MIN_Y MESH_INSET - #define MESH_MAX_Y (Y_BED_SIZE - (MESH_INSET)) + #if ENABLED(DELTA) + // 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 MESH_MIN_X (X_CENTER - (DELTA_PROBEABLE_RADIUS) + MESH_INSET) + #define MESH_MIN_Y (Y_CENTER - (DELTA_PROBEABLE_RADIUS) + MESH_INSET) + #define MESH_MAX_X (X_CENTER + DELTA_PROBEABLE_RADIUS - (MESH_INSET)) + #define MESH_MAX_Y (Y_CENTER + DELTA_PROBEABLE_RADIUS - (MESH_INSET)) + #elif IS_SCARA + #define MESH_MIN_X (X_CENTER - (SCARA_PRINTABLE_RADIUS) + MESH_INSET) + #define MESH_MIN_Y (Y_CENTER - (SCARA_PRINTABLE_RADIUS) + MESH_INSET) + #define MESH_MAX_X (X_CENTER + SCARA_PRINTABLE_RADIUS - (MESH_INSET)) + #define MESH_MAX_Y (Y_CENTER + SCARA_PRINTABLE_RADIUS - (MESH_INSET)) + #else + // Boundaries for Cartesian probing based on set limits + #if ENABLED(BED_CENTER_AT_0_0) + #define MESH_MIN_X (max(MESH_INSET, 0) - (X_BED_SIZE) / 2) + #define MESH_MIN_Y (max(MESH_INSET, 0) - (Y_BED_SIZE) / 2) + #define MESH_MAX_X (min(X_BED_SIZE - (MESH_INSET), X_BED_SIZE) - (X_BED_SIZE) / 2) + #define MESH_MAX_Y (min(Y_BED_SIZE - (MESH_INSET), Y_BED_SIZE) - (Y_BED_SIZE) / 2) + #else + #define MESH_MIN_X (max(X_MIN_POS + MESH_INSET, 0)) + #define MESH_MIN_Y (max(Y_MIN_POS + MESH_INSET, 0)) + #define MESH_MAX_X (min(X_MAX_POS - (MESH_INSET), X_BED_SIZE)) + #define MESH_MAX_Y (min(Y_MAX_POS - (MESH_INSET), Y_BED_SIZE)) + #endif + #endif #elif ENABLED(AUTO_BED_LEVELING_UBL) - #define UBL_MESH_MIN_X UBL_MESH_INSET - #define UBL_MESH_MAX_X (X_BED_SIZE - (UBL_MESH_INSET)) - #define UBL_MESH_MIN_Y UBL_MESH_INSET - #define UBL_MESH_MAX_Y (Y_BED_SIZE - (UBL_MESH_INSET)) + #if ENABLED(DELTA) + // 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 UBL_MESH_MIN_X (X_CENTER - (DELTA_PROBEABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MIN_Y (Y_CENTER - (DELTA_PROBEABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MAX_X (X_CENTER + DELTA_PROBEABLE_RADIUS - (UBL_MESH_INSET)) + #define UBL_MESH_MAX_Y (Y_CENTER + DELTA_PROBEABLE_RADIUS - (UBL_MESH_INSET)) + #elif IS_SCARA + #define UBL_MESH_MIN_X (X_CENTER - (SCARA_PRINTABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MIN_Y (Y_CENTER - (SCARA_PRINTABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MAX_X (X_CENTER + SCARA_PRINTABLE_RADIUS - (UBL_MESH_INSET)) + #define UBL_MESH_MAX_Y (Y_CENTER + SCARA_PRINTABLE_RADIUS - (UBL_MESH_INSET)) + #else + // Boundaries for Cartesian probing based on set limits + #if ENABLED(BED_CENTER_AT_0_0) + #define UBL_MESH_MIN_X (max(UBL_MESH_INSET, 0) - (X_BED_SIZE) / 2) + #define UBL_MESH_MIN_Y (max(UBL_MESH_INSET, 0) - (Y_BED_SIZE) / 2) + #define UBL_MESH_MAX_X (min(X_BED_SIZE - (UBL_MESH_INSET), X_BED_SIZE) - (X_BED_SIZE) / 2) + #define UBL_MESH_MAX_Y (min(Y_BED_SIZE - (UBL_MESH_INSET), Y_BED_SIZE) - (Y_BED_SIZE) / 2) + #else + #define UBL_MESH_MIN_X (max(X_MIN_POS + UBL_MESH_INSET, 0)) + #define UBL_MESH_MIN_Y (max(Y_MIN_POS + UBL_MESH_INSET, 0)) + #define UBL_MESH_MAX_X (min(X_MAX_POS - (UBL_MESH_INSET), X_BED_SIZE)) + #define UBL_MESH_MAX_Y (min(Y_MAX_POS - (UBL_MESH_INSET), Y_BED_SIZE)) + #endif + #endif // If this is defined, the currently active mesh will be saved in the // current slot on M500. diff --git a/Marlin/src/config/examples/Cartesio/Configuration_adv.h b/Marlin/src/config/examples/Cartesio/Configuration_adv.h index 5c4258ffc7..cda6da7726 100644 --- a/Marlin/src/config/examples/Cartesio/Configuration_adv.h +++ b/Marlin/src/config/examples/Cartesio/Configuration_adv.h @@ -673,19 +673,71 @@ // @section leveling +#if ENABLED(DELTA) && !defined(DELTA_PROBEABLE_RADIUS) + #define DELTA_PROBEABLE_RADIUS DELTA_PRINTABLE_RADIUS +#elif IS_SCARA && !defined(SCARA_PRINTABLE_RADIUS) + #define SCARA_PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2) +#endif + // Default mesh area is an area with an inset margin on the print area. // Below are the macros that are used to define the borders for the mesh area, // made available here for specialized needs, ie dual extruder setup. #if ENABLED(MESH_BED_LEVELING) - #define MESH_MIN_X MESH_INSET - #define MESH_MAX_X (X_BED_SIZE - (MESH_INSET)) - #define MESH_MIN_Y MESH_INSET - #define MESH_MAX_Y (Y_BED_SIZE - (MESH_INSET)) + #if ENABLED(DELTA) + // 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 MESH_MIN_X (X_CENTER - (DELTA_PROBEABLE_RADIUS) + MESH_INSET) + #define MESH_MIN_Y (Y_CENTER - (DELTA_PROBEABLE_RADIUS) + MESH_INSET) + #define MESH_MAX_X (X_CENTER + DELTA_PROBEABLE_RADIUS - (MESH_INSET)) + #define MESH_MAX_Y (Y_CENTER + DELTA_PROBEABLE_RADIUS - (MESH_INSET)) + #elif IS_SCARA + #define MESH_MIN_X (X_CENTER - (SCARA_PRINTABLE_RADIUS) + MESH_INSET) + #define MESH_MIN_Y (Y_CENTER - (SCARA_PRINTABLE_RADIUS) + MESH_INSET) + #define MESH_MAX_X (X_CENTER + SCARA_PRINTABLE_RADIUS - (MESH_INSET)) + #define MESH_MAX_Y (Y_CENTER + SCARA_PRINTABLE_RADIUS - (MESH_INSET)) + #else + // Boundaries for Cartesian probing based on set limits + #if ENABLED(BED_CENTER_AT_0_0) + #define MESH_MIN_X (max(MESH_INSET, 0) - (X_BED_SIZE) / 2) + #define MESH_MIN_Y (max(MESH_INSET, 0) - (Y_BED_SIZE) / 2) + #define MESH_MAX_X (min(X_BED_SIZE - (MESH_INSET), X_BED_SIZE) - (X_BED_SIZE) / 2) + #define MESH_MAX_Y (min(Y_BED_SIZE - (MESH_INSET), Y_BED_SIZE) - (Y_BED_SIZE) / 2) + #else + #define MESH_MIN_X (max(X_MIN_POS + MESH_INSET, 0)) + #define MESH_MIN_Y (max(Y_MIN_POS + MESH_INSET, 0)) + #define MESH_MAX_X (min(X_MAX_POS - (MESH_INSET), X_BED_SIZE)) + #define MESH_MAX_Y (min(Y_MAX_POS - (MESH_INSET), Y_BED_SIZE)) + #endif + #endif #elif ENABLED(AUTO_BED_LEVELING_UBL) - #define UBL_MESH_MIN_X UBL_MESH_INSET - #define UBL_MESH_MAX_X (X_BED_SIZE - (UBL_MESH_INSET)) - #define UBL_MESH_MIN_Y UBL_MESH_INSET - #define UBL_MESH_MAX_Y (Y_BED_SIZE - (UBL_MESH_INSET)) + #if ENABLED(DELTA) + // 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 UBL_MESH_MIN_X (X_CENTER - (DELTA_PROBEABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MIN_Y (Y_CENTER - (DELTA_PROBEABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MAX_X (X_CENTER + DELTA_PROBEABLE_RADIUS - (UBL_MESH_INSET)) + #define UBL_MESH_MAX_Y (Y_CENTER + DELTA_PROBEABLE_RADIUS - (UBL_MESH_INSET)) + #elif IS_SCARA + #define UBL_MESH_MIN_X (X_CENTER - (SCARA_PRINTABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MIN_Y (Y_CENTER - (SCARA_PRINTABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MAX_X (X_CENTER + SCARA_PRINTABLE_RADIUS - (UBL_MESH_INSET)) + #define UBL_MESH_MAX_Y (Y_CENTER + SCARA_PRINTABLE_RADIUS - (UBL_MESH_INSET)) + #else + // Boundaries for Cartesian probing based on set limits + #if ENABLED(BED_CENTER_AT_0_0) + #define UBL_MESH_MIN_X (max(UBL_MESH_INSET, 0) - (X_BED_SIZE) / 2) + #define UBL_MESH_MIN_Y (max(UBL_MESH_INSET, 0) - (Y_BED_SIZE) / 2) + #define UBL_MESH_MAX_X (min(X_BED_SIZE - (UBL_MESH_INSET), X_BED_SIZE) - (X_BED_SIZE) / 2) + #define UBL_MESH_MAX_Y (min(Y_BED_SIZE - (UBL_MESH_INSET), Y_BED_SIZE) - (Y_BED_SIZE) / 2) + #else + #define UBL_MESH_MIN_X (max(X_MIN_POS + UBL_MESH_INSET, 0)) + #define UBL_MESH_MIN_Y (max(Y_MIN_POS + UBL_MESH_INSET, 0)) + #define UBL_MESH_MAX_X (min(X_MAX_POS - (UBL_MESH_INSET), X_BED_SIZE)) + #define UBL_MESH_MAX_Y (min(Y_MAX_POS - (UBL_MESH_INSET), Y_BED_SIZE)) + #endif + #endif // If this is defined, the currently active mesh will be saved in the // current slot on M500. diff --git a/Marlin/src/config/examples/Creality/CR-10/Configuration_adv.h b/Marlin/src/config/examples/Creality/CR-10/Configuration_adv.h index 9db1c5dec3..72605e8a46 100644 --- a/Marlin/src/config/examples/Creality/CR-10/Configuration_adv.h +++ b/Marlin/src/config/examples/Creality/CR-10/Configuration_adv.h @@ -673,19 +673,71 @@ // @section leveling +#if ENABLED(DELTA) && !defined(DELTA_PROBEABLE_RADIUS) + #define DELTA_PROBEABLE_RADIUS DELTA_PRINTABLE_RADIUS +#elif IS_SCARA && !defined(SCARA_PRINTABLE_RADIUS) + #define SCARA_PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2) +#endif + // Default mesh area is an area with an inset margin on the print area. // Below are the macros that are used to define the borders for the mesh area, // made available here for specialized needs, ie dual extruder setup. #if ENABLED(MESH_BED_LEVELING) - #define MESH_MIN_X MESH_INSET - #define MESH_MAX_X (X_BED_SIZE - (MESH_INSET)) - #define MESH_MIN_Y MESH_INSET - #define MESH_MAX_Y (Y_BED_SIZE - (MESH_INSET)) + #if ENABLED(DELTA) + // 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 MESH_MIN_X (X_CENTER - (DELTA_PROBEABLE_RADIUS) + MESH_INSET) + #define MESH_MIN_Y (Y_CENTER - (DELTA_PROBEABLE_RADIUS) + MESH_INSET) + #define MESH_MAX_X (X_CENTER + DELTA_PROBEABLE_RADIUS - (MESH_INSET)) + #define MESH_MAX_Y (Y_CENTER + DELTA_PROBEABLE_RADIUS - (MESH_INSET)) + #elif IS_SCARA + #define MESH_MIN_X (X_CENTER - (SCARA_PRINTABLE_RADIUS) + MESH_INSET) + #define MESH_MIN_Y (Y_CENTER - (SCARA_PRINTABLE_RADIUS) + MESH_INSET) + #define MESH_MAX_X (X_CENTER + SCARA_PRINTABLE_RADIUS - (MESH_INSET)) + #define MESH_MAX_Y (Y_CENTER + SCARA_PRINTABLE_RADIUS - (MESH_INSET)) + #else + // Boundaries for Cartesian probing based on set limits + #if ENABLED(BED_CENTER_AT_0_0) + #define MESH_MIN_X (max(MESH_INSET, 0) - (X_BED_SIZE) / 2) + #define MESH_MIN_Y (max(MESH_INSET, 0) - (Y_BED_SIZE) / 2) + #define MESH_MAX_X (min(X_BED_SIZE - (MESH_INSET), X_BED_SIZE) - (X_BED_SIZE) / 2) + #define MESH_MAX_Y (min(Y_BED_SIZE - (MESH_INSET), Y_BED_SIZE) - (Y_BED_SIZE) / 2) + #else + #define MESH_MIN_X (max(X_MIN_POS + MESH_INSET, 0)) + #define MESH_MIN_Y (max(Y_MIN_POS + MESH_INSET, 0)) + #define MESH_MAX_X (min(X_MAX_POS - (MESH_INSET), X_BED_SIZE)) + #define MESH_MAX_Y (min(Y_MAX_POS - (MESH_INSET), Y_BED_SIZE)) + #endif + #endif #elif ENABLED(AUTO_BED_LEVELING_UBL) - #define UBL_MESH_MIN_X UBL_MESH_INSET - #define UBL_MESH_MAX_X (X_BED_SIZE - (UBL_MESH_INSET)) - #define UBL_MESH_MIN_Y UBL_MESH_INSET - #define UBL_MESH_MAX_Y (Y_BED_SIZE - (UBL_MESH_INSET)) + #if ENABLED(DELTA) + // 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 UBL_MESH_MIN_X (X_CENTER - (DELTA_PROBEABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MIN_Y (Y_CENTER - (DELTA_PROBEABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MAX_X (X_CENTER + DELTA_PROBEABLE_RADIUS - (UBL_MESH_INSET)) + #define UBL_MESH_MAX_Y (Y_CENTER + DELTA_PROBEABLE_RADIUS - (UBL_MESH_INSET)) + #elif IS_SCARA + #define UBL_MESH_MIN_X (X_CENTER - (SCARA_PRINTABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MIN_Y (Y_CENTER - (SCARA_PRINTABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MAX_X (X_CENTER + SCARA_PRINTABLE_RADIUS - (UBL_MESH_INSET)) + #define UBL_MESH_MAX_Y (Y_CENTER + SCARA_PRINTABLE_RADIUS - (UBL_MESH_INSET)) + #else + // Boundaries for Cartesian probing based on set limits + #if ENABLED(BED_CENTER_AT_0_0) + #define UBL_MESH_MIN_X (max(UBL_MESH_INSET, 0) - (X_BED_SIZE) / 2) + #define UBL_MESH_MIN_Y (max(UBL_MESH_INSET, 0) - (Y_BED_SIZE) / 2) + #define UBL_MESH_MAX_X (min(X_BED_SIZE - (UBL_MESH_INSET), X_BED_SIZE) - (X_BED_SIZE) / 2) + #define UBL_MESH_MAX_Y (min(Y_BED_SIZE - (UBL_MESH_INSET), Y_BED_SIZE) - (Y_BED_SIZE) / 2) + #else + #define UBL_MESH_MIN_X (max(X_MIN_POS + UBL_MESH_INSET, 0)) + #define UBL_MESH_MIN_Y (max(Y_MIN_POS + UBL_MESH_INSET, 0)) + #define UBL_MESH_MAX_X (min(X_MAX_POS - (UBL_MESH_INSET), X_BED_SIZE)) + #define UBL_MESH_MAX_Y (min(Y_MAX_POS - (UBL_MESH_INSET), Y_BED_SIZE)) + #endif + #endif // If this is defined, the currently active mesh will be saved in the // current slot on M500. diff --git a/Marlin/src/config/examples/Felix/Configuration_adv.h b/Marlin/src/config/examples/Felix/Configuration_adv.h index 0e69ced075..b5b21c341c 100644 --- a/Marlin/src/config/examples/Felix/Configuration_adv.h +++ b/Marlin/src/config/examples/Felix/Configuration_adv.h @@ -673,19 +673,71 @@ // @section leveling +#if ENABLED(DELTA) && !defined(DELTA_PROBEABLE_RADIUS) + #define DELTA_PROBEABLE_RADIUS DELTA_PRINTABLE_RADIUS +#elif IS_SCARA && !defined(SCARA_PRINTABLE_RADIUS) + #define SCARA_PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2) +#endif + // Default mesh area is an area with an inset margin on the print area. // Below are the macros that are used to define the borders for the mesh area, // made available here for specialized needs, ie dual extruder setup. #if ENABLED(MESH_BED_LEVELING) - #define MESH_MIN_X MESH_INSET - #define MESH_MAX_X (X_BED_SIZE - (MESH_INSET)) - #define MESH_MIN_Y MESH_INSET - #define MESH_MAX_Y (Y_BED_SIZE - (MESH_INSET)) + #if ENABLED(DELTA) + // 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 MESH_MIN_X (X_CENTER - (DELTA_PROBEABLE_RADIUS) + MESH_INSET) + #define MESH_MIN_Y (Y_CENTER - (DELTA_PROBEABLE_RADIUS) + MESH_INSET) + #define MESH_MAX_X (X_CENTER + DELTA_PROBEABLE_RADIUS - (MESH_INSET)) + #define MESH_MAX_Y (Y_CENTER + DELTA_PROBEABLE_RADIUS - (MESH_INSET)) + #elif IS_SCARA + #define MESH_MIN_X (X_CENTER - (SCARA_PRINTABLE_RADIUS) + MESH_INSET) + #define MESH_MIN_Y (Y_CENTER - (SCARA_PRINTABLE_RADIUS) + MESH_INSET) + #define MESH_MAX_X (X_CENTER + SCARA_PRINTABLE_RADIUS - (MESH_INSET)) + #define MESH_MAX_Y (Y_CENTER + SCARA_PRINTABLE_RADIUS - (MESH_INSET)) + #else + // Boundaries for Cartesian probing based on set limits + #if ENABLED(BED_CENTER_AT_0_0) + #define MESH_MIN_X (max(MESH_INSET, 0) - (X_BED_SIZE) / 2) + #define MESH_MIN_Y (max(MESH_INSET, 0) - (Y_BED_SIZE) / 2) + #define MESH_MAX_X (min(X_BED_SIZE - (MESH_INSET), X_BED_SIZE) - (X_BED_SIZE) / 2) + #define MESH_MAX_Y (min(Y_BED_SIZE - (MESH_INSET), Y_BED_SIZE) - (Y_BED_SIZE) / 2) + #else + #define MESH_MIN_X (max(X_MIN_POS + MESH_INSET, 0)) + #define MESH_MIN_Y (max(Y_MIN_POS + MESH_INSET, 0)) + #define MESH_MAX_X (min(X_MAX_POS - (MESH_INSET), X_BED_SIZE)) + #define MESH_MAX_Y (min(Y_MAX_POS - (MESH_INSET), Y_BED_SIZE)) + #endif + #endif #elif ENABLED(AUTO_BED_LEVELING_UBL) - #define UBL_MESH_MIN_X UBL_MESH_INSET - #define UBL_MESH_MAX_X (X_BED_SIZE - (UBL_MESH_INSET)) - #define UBL_MESH_MIN_Y UBL_MESH_INSET - #define UBL_MESH_MAX_Y (Y_BED_SIZE - (UBL_MESH_INSET)) + #if ENABLED(DELTA) + // 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 UBL_MESH_MIN_X (X_CENTER - (DELTA_PROBEABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MIN_Y (Y_CENTER - (DELTA_PROBEABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MAX_X (X_CENTER + DELTA_PROBEABLE_RADIUS - (UBL_MESH_INSET)) + #define UBL_MESH_MAX_Y (Y_CENTER + DELTA_PROBEABLE_RADIUS - (UBL_MESH_INSET)) + #elif IS_SCARA + #define UBL_MESH_MIN_X (X_CENTER - (SCARA_PRINTABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MIN_Y (Y_CENTER - (SCARA_PRINTABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MAX_X (X_CENTER + SCARA_PRINTABLE_RADIUS - (UBL_MESH_INSET)) + #define UBL_MESH_MAX_Y (Y_CENTER + SCARA_PRINTABLE_RADIUS - (UBL_MESH_INSET)) + #else + // Boundaries for Cartesian probing based on set limits + #if ENABLED(BED_CENTER_AT_0_0) + #define UBL_MESH_MIN_X (max(UBL_MESH_INSET, 0) - (X_BED_SIZE) / 2) + #define UBL_MESH_MIN_Y (max(UBL_MESH_INSET, 0) - (Y_BED_SIZE) / 2) + #define UBL_MESH_MAX_X (min(X_BED_SIZE - (UBL_MESH_INSET), X_BED_SIZE) - (X_BED_SIZE) / 2) + #define UBL_MESH_MAX_Y (min(Y_BED_SIZE - (UBL_MESH_INSET), Y_BED_SIZE) - (Y_BED_SIZE) / 2) + #else + #define UBL_MESH_MIN_X (max(X_MIN_POS + UBL_MESH_INSET, 0)) + #define UBL_MESH_MIN_Y (max(Y_MIN_POS + UBL_MESH_INSET, 0)) + #define UBL_MESH_MAX_X (min(X_MAX_POS - (UBL_MESH_INSET), X_BED_SIZE)) + #define UBL_MESH_MAX_Y (min(Y_MAX_POS - (UBL_MESH_INSET), Y_BED_SIZE)) + #endif + #endif // If this is defined, the currently active mesh will be saved in the // current slot on M500. diff --git a/Marlin/src/config/examples/Folger Tech/i3-2020/Configuration_adv.h b/Marlin/src/config/examples/Folger Tech/i3-2020/Configuration_adv.h index 3a4f39e6e1..1119045dcd 100644 --- a/Marlin/src/config/examples/Folger Tech/i3-2020/Configuration_adv.h +++ b/Marlin/src/config/examples/Folger Tech/i3-2020/Configuration_adv.h @@ -674,19 +674,71 @@ // @section leveling +#if ENABLED(DELTA) && !defined(DELTA_PROBEABLE_RADIUS) + #define DELTA_PROBEABLE_RADIUS DELTA_PRINTABLE_RADIUS +#elif IS_SCARA && !defined(SCARA_PRINTABLE_RADIUS) + #define SCARA_PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2) +#endif + // Default mesh area is an area with an inset margin on the print area. // Below are the macros that are used to define the borders for the mesh area, // made available here for specialized needs, ie dual extruder setup. #if ENABLED(MESH_BED_LEVELING) - #define MESH_MIN_X MESH_INSET - #define MESH_MAX_X (X_BED_SIZE - (MESH_INSET)) - #define MESH_MIN_Y MESH_INSET - #define MESH_MAX_Y (Y_BED_SIZE - (MESH_INSET)) + #if ENABLED(DELTA) + // 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 MESH_MIN_X (X_CENTER - (DELTA_PROBEABLE_RADIUS) + MESH_INSET) + #define MESH_MIN_Y (Y_CENTER - (DELTA_PROBEABLE_RADIUS) + MESH_INSET) + #define MESH_MAX_X (X_CENTER + DELTA_PROBEABLE_RADIUS - (MESH_INSET)) + #define MESH_MAX_Y (Y_CENTER + DELTA_PROBEABLE_RADIUS - (MESH_INSET)) + #elif IS_SCARA + #define MESH_MIN_X (X_CENTER - (SCARA_PRINTABLE_RADIUS) + MESH_INSET) + #define MESH_MIN_Y (Y_CENTER - (SCARA_PRINTABLE_RADIUS) + MESH_INSET) + #define MESH_MAX_X (X_CENTER + SCARA_PRINTABLE_RADIUS - (MESH_INSET)) + #define MESH_MAX_Y (Y_CENTER + SCARA_PRINTABLE_RADIUS - (MESH_INSET)) + #else + // Boundaries for Cartesian probing based on set limits + #if ENABLED(BED_CENTER_AT_0_0) + #define MESH_MIN_X (max(MESH_INSET, 0) - (X_BED_SIZE) / 2) + #define MESH_MIN_Y (max(MESH_INSET, 0) - (Y_BED_SIZE) / 2) + #define MESH_MAX_X (min(X_BED_SIZE - (MESH_INSET), X_BED_SIZE) - (X_BED_SIZE) / 2) + #define MESH_MAX_Y (min(Y_BED_SIZE - (MESH_INSET), Y_BED_SIZE) - (Y_BED_SIZE) / 2) + #else + #define MESH_MIN_X (max(X_MIN_POS + MESH_INSET, 0)) + #define MESH_MIN_Y (max(Y_MIN_POS + MESH_INSET, 0)) + #define MESH_MAX_X (min(X_MAX_POS - (MESH_INSET), X_BED_SIZE)) + #define MESH_MAX_Y (min(Y_MAX_POS - (MESH_INSET), Y_BED_SIZE)) + #endif + #endif #elif ENABLED(AUTO_BED_LEVELING_UBL) - #define UBL_MESH_MIN_X UBL_MESH_INSET - #define UBL_MESH_MAX_X (X_BED_SIZE - (UBL_MESH_INSET)) - #define UBL_MESH_MIN_Y UBL_MESH_INSET - #define UBL_MESH_MAX_Y (Y_BED_SIZE - (UBL_MESH_INSET)) + #if ENABLED(DELTA) + // 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 UBL_MESH_MIN_X (X_CENTER - (DELTA_PROBEABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MIN_Y (Y_CENTER - (DELTA_PROBEABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MAX_X (X_CENTER + DELTA_PROBEABLE_RADIUS - (UBL_MESH_INSET)) + #define UBL_MESH_MAX_Y (Y_CENTER + DELTA_PROBEABLE_RADIUS - (UBL_MESH_INSET)) + #elif IS_SCARA + #define UBL_MESH_MIN_X (X_CENTER - (SCARA_PRINTABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MIN_Y (Y_CENTER - (SCARA_PRINTABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MAX_X (X_CENTER + SCARA_PRINTABLE_RADIUS - (UBL_MESH_INSET)) + #define UBL_MESH_MAX_Y (Y_CENTER + SCARA_PRINTABLE_RADIUS - (UBL_MESH_INSET)) + #else + // Boundaries for Cartesian probing based on set limits + #if ENABLED(BED_CENTER_AT_0_0) + #define UBL_MESH_MIN_X (max(UBL_MESH_INSET, 0) - (X_BED_SIZE) / 2) + #define UBL_MESH_MIN_Y (max(UBL_MESH_INSET, 0) - (Y_BED_SIZE) / 2) + #define UBL_MESH_MAX_X (min(X_BED_SIZE - (UBL_MESH_INSET), X_BED_SIZE) - (X_BED_SIZE) / 2) + #define UBL_MESH_MAX_Y (min(Y_BED_SIZE - (UBL_MESH_INSET), Y_BED_SIZE) - (Y_BED_SIZE) / 2) + #else + #define UBL_MESH_MIN_X (max(X_MIN_POS + UBL_MESH_INSET, 0)) + #define UBL_MESH_MIN_Y (max(Y_MIN_POS + UBL_MESH_INSET, 0)) + #define UBL_MESH_MAX_X (min(X_MAX_POS - (UBL_MESH_INSET), X_BED_SIZE)) + #define UBL_MESH_MAX_Y (min(Y_MAX_POS - (UBL_MESH_INSET), Y_BED_SIZE)) + #endif + #endif // If this is defined, the currently active mesh will be saved in the // current slot on M500. diff --git a/Marlin/src/config/examples/Infitary/i3-M508/Configuration_adv.h b/Marlin/src/config/examples/Infitary/i3-M508/Configuration_adv.h index 46328cb5ca..ddebb35eb3 100644 --- a/Marlin/src/config/examples/Infitary/i3-M508/Configuration_adv.h +++ b/Marlin/src/config/examples/Infitary/i3-M508/Configuration_adv.h @@ -673,19 +673,71 @@ // @section leveling +#if ENABLED(DELTA) && !defined(DELTA_PROBEABLE_RADIUS) + #define DELTA_PROBEABLE_RADIUS DELTA_PRINTABLE_RADIUS +#elif IS_SCARA && !defined(SCARA_PRINTABLE_RADIUS) + #define SCARA_PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2) +#endif + // Default mesh area is an area with an inset margin on the print area. // Below are the macros that are used to define the borders for the mesh area, // made available here for specialized needs, ie dual extruder setup. #if ENABLED(MESH_BED_LEVELING) - #define MESH_MIN_X MESH_INSET - #define MESH_MAX_X (X_BED_SIZE - (MESH_INSET)) - #define MESH_MIN_Y MESH_INSET - #define MESH_MAX_Y (Y_BED_SIZE - (MESH_INSET)) + #if ENABLED(DELTA) + // 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 MESH_MIN_X (X_CENTER - (DELTA_PROBEABLE_RADIUS) + MESH_INSET) + #define MESH_MIN_Y (Y_CENTER - (DELTA_PROBEABLE_RADIUS) + MESH_INSET) + #define MESH_MAX_X (X_CENTER + DELTA_PROBEABLE_RADIUS - (MESH_INSET)) + #define MESH_MAX_Y (Y_CENTER + DELTA_PROBEABLE_RADIUS - (MESH_INSET)) + #elif IS_SCARA + #define MESH_MIN_X (X_CENTER - (SCARA_PRINTABLE_RADIUS) + MESH_INSET) + #define MESH_MIN_Y (Y_CENTER - (SCARA_PRINTABLE_RADIUS) + MESH_INSET) + #define MESH_MAX_X (X_CENTER + SCARA_PRINTABLE_RADIUS - (MESH_INSET)) + #define MESH_MAX_Y (Y_CENTER + SCARA_PRINTABLE_RADIUS - (MESH_INSET)) + #else + // Boundaries for Cartesian probing based on set limits + #if ENABLED(BED_CENTER_AT_0_0) + #define MESH_MIN_X (max(MESH_INSET, 0) - (X_BED_SIZE) / 2) + #define MESH_MIN_Y (max(MESH_INSET, 0) - (Y_BED_SIZE) / 2) + #define MESH_MAX_X (min(X_BED_SIZE - (MESH_INSET), X_BED_SIZE) - (X_BED_SIZE) / 2) + #define MESH_MAX_Y (min(Y_BED_SIZE - (MESH_INSET), Y_BED_SIZE) - (Y_BED_SIZE) / 2) + #else + #define MESH_MIN_X (max(X_MIN_POS + MESH_INSET, 0)) + #define MESH_MIN_Y (max(Y_MIN_POS + MESH_INSET, 0)) + #define MESH_MAX_X (min(X_MAX_POS - (MESH_INSET), X_BED_SIZE)) + #define MESH_MAX_Y (min(Y_MAX_POS - (MESH_INSET), Y_BED_SIZE)) + #endif + #endif #elif ENABLED(AUTO_BED_LEVELING_UBL) - #define UBL_MESH_MIN_X UBL_MESH_INSET - #define UBL_MESH_MAX_X (X_BED_SIZE - (UBL_MESH_INSET)) - #define UBL_MESH_MIN_Y UBL_MESH_INSET - #define UBL_MESH_MAX_Y (Y_BED_SIZE - (UBL_MESH_INSET)) + #if ENABLED(DELTA) + // 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 UBL_MESH_MIN_X (X_CENTER - (DELTA_PROBEABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MIN_Y (Y_CENTER - (DELTA_PROBEABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MAX_X (X_CENTER + DELTA_PROBEABLE_RADIUS - (UBL_MESH_INSET)) + #define UBL_MESH_MAX_Y (Y_CENTER + DELTA_PROBEABLE_RADIUS - (UBL_MESH_INSET)) + #elif IS_SCARA + #define UBL_MESH_MIN_X (X_CENTER - (SCARA_PRINTABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MIN_Y (Y_CENTER - (SCARA_PRINTABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MAX_X (X_CENTER + SCARA_PRINTABLE_RADIUS - (UBL_MESH_INSET)) + #define UBL_MESH_MAX_Y (Y_CENTER + SCARA_PRINTABLE_RADIUS - (UBL_MESH_INSET)) + #else + // Boundaries for Cartesian probing based on set limits + #if ENABLED(BED_CENTER_AT_0_0) + #define UBL_MESH_MIN_X (max(UBL_MESH_INSET, 0) - (X_BED_SIZE) / 2) + #define UBL_MESH_MIN_Y (max(UBL_MESH_INSET, 0) - (Y_BED_SIZE) / 2) + #define UBL_MESH_MAX_X (min(X_BED_SIZE - (UBL_MESH_INSET), X_BED_SIZE) - (X_BED_SIZE) / 2) + #define UBL_MESH_MAX_Y (min(Y_BED_SIZE - (UBL_MESH_INSET), Y_BED_SIZE) - (Y_BED_SIZE) / 2) + #else + #define UBL_MESH_MIN_X (max(X_MIN_POS + UBL_MESH_INSET, 0)) + #define UBL_MESH_MIN_Y (max(Y_MIN_POS + UBL_MESH_INSET, 0)) + #define UBL_MESH_MAX_X (min(X_MAX_POS - (UBL_MESH_INSET), X_BED_SIZE)) + #define UBL_MESH_MAX_Y (min(Y_MAX_POS - (UBL_MESH_INSET), Y_BED_SIZE)) + #endif + #endif // If this is defined, the currently active mesh will be saved in the // current slot on M500. diff --git a/Marlin/src/config/examples/Malyan/M150/Configuration_adv.h b/Marlin/src/config/examples/Malyan/M150/Configuration_adv.h index 40c37d3588..cc9a5242ad 100644 --- a/Marlin/src/config/examples/Malyan/M150/Configuration_adv.h +++ b/Marlin/src/config/examples/Malyan/M150/Configuration_adv.h @@ -670,19 +670,71 @@ // @section leveling +#if ENABLED(DELTA) && !defined(DELTA_PROBEABLE_RADIUS) + #define DELTA_PROBEABLE_RADIUS DELTA_PRINTABLE_RADIUS +#elif IS_SCARA && !defined(SCARA_PRINTABLE_RADIUS) + #define SCARA_PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2) +#endif + // Default mesh area is an area with an inset margin on the print area. // Below are the macros that are used to define the borders for the mesh area, // made available here for specialized needs, ie dual extruder setup. #if ENABLED(MESH_BED_LEVELING) - #define MESH_MIN_X MESH_INSET - #define MESH_MAX_X (X_BED_SIZE - (MESH_INSET)) - #define MESH_MIN_Y MESH_INSET - #define MESH_MAX_Y (Y_BED_SIZE - (MESH_INSET)) + #if ENABLED(DELTA) + // 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 MESH_MIN_X (X_CENTER - (DELTA_PROBEABLE_RADIUS) + MESH_INSET) + #define MESH_MIN_Y (Y_CENTER - (DELTA_PROBEABLE_RADIUS) + MESH_INSET) + #define MESH_MAX_X (X_CENTER + DELTA_PROBEABLE_RADIUS - (MESH_INSET)) + #define MESH_MAX_Y (Y_CENTER + DELTA_PROBEABLE_RADIUS - (MESH_INSET)) + #elif IS_SCARA + #define MESH_MIN_X (X_CENTER - (SCARA_PRINTABLE_RADIUS) + MESH_INSET) + #define MESH_MIN_Y (Y_CENTER - (SCARA_PRINTABLE_RADIUS) + MESH_INSET) + #define MESH_MAX_X (X_CENTER + SCARA_PRINTABLE_RADIUS - (MESH_INSET)) + #define MESH_MAX_Y (Y_CENTER + SCARA_PRINTABLE_RADIUS - (MESH_INSET)) + #else + // Boundaries for Cartesian probing based on set limits + #if ENABLED(BED_CENTER_AT_0_0) + #define MESH_MIN_X (max(MESH_INSET, 0) - (X_BED_SIZE) / 2) + #define MESH_MIN_Y (max(MESH_INSET, 0) - (Y_BED_SIZE) / 2) + #define MESH_MAX_X (min(X_BED_SIZE - (MESH_INSET), X_BED_SIZE) - (X_BED_SIZE) / 2) + #define MESH_MAX_Y (min(Y_BED_SIZE - (MESH_INSET), Y_BED_SIZE) - (Y_BED_SIZE) / 2) + #else + #define MESH_MIN_X (max(X_MIN_POS + MESH_INSET, 0)) + #define MESH_MIN_Y (max(Y_MIN_POS + MESH_INSET, 0)) + #define MESH_MAX_X (min(X_MAX_POS - (MESH_INSET), X_BED_SIZE)) + #define MESH_MAX_Y (min(Y_MAX_POS - (MESH_INSET), Y_BED_SIZE)) + #endif + #endif #elif ENABLED(AUTO_BED_LEVELING_UBL) - #define UBL_MESH_MIN_X UBL_MESH_INSET - #define UBL_MESH_MAX_X (X_BED_SIZE - (UBL_MESH_INSET)) - #define UBL_MESH_MIN_Y UBL_MESH_INSET - #define UBL_MESH_MAX_Y (Y_BED_SIZE - (UBL_MESH_INSET)) + #if ENABLED(DELTA) + // 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 UBL_MESH_MIN_X (X_CENTER - (DELTA_PROBEABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MIN_Y (Y_CENTER - (DELTA_PROBEABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MAX_X (X_CENTER + DELTA_PROBEABLE_RADIUS - (UBL_MESH_INSET)) + #define UBL_MESH_MAX_Y (Y_CENTER + DELTA_PROBEABLE_RADIUS - (UBL_MESH_INSET)) + #elif IS_SCARA + #define UBL_MESH_MIN_X (X_CENTER - (SCARA_PRINTABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MIN_Y (Y_CENTER - (SCARA_PRINTABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MAX_X (X_CENTER + SCARA_PRINTABLE_RADIUS - (UBL_MESH_INSET)) + #define UBL_MESH_MAX_Y (Y_CENTER + SCARA_PRINTABLE_RADIUS - (UBL_MESH_INSET)) + #else + // Boundaries for Cartesian probing based on set limits + #if ENABLED(BED_CENTER_AT_0_0) + #define UBL_MESH_MIN_X (max(UBL_MESH_INSET, 0) - (X_BED_SIZE) / 2) + #define UBL_MESH_MIN_Y (max(UBL_MESH_INSET, 0) - (Y_BED_SIZE) / 2) + #define UBL_MESH_MAX_X (min(X_BED_SIZE - (UBL_MESH_INSET), X_BED_SIZE) - (X_BED_SIZE) / 2) + #define UBL_MESH_MAX_Y (min(Y_BED_SIZE - (UBL_MESH_INSET), Y_BED_SIZE) - (Y_BED_SIZE) / 2) + #else + #define UBL_MESH_MIN_X (max(X_MIN_POS + UBL_MESH_INSET, 0)) + #define UBL_MESH_MIN_Y (max(Y_MIN_POS + UBL_MESH_INSET, 0)) + #define UBL_MESH_MAX_X (min(X_MAX_POS - (UBL_MESH_INSET), X_BED_SIZE)) + #define UBL_MESH_MAX_Y (min(Y_MAX_POS - (UBL_MESH_INSET), Y_BED_SIZE)) + #endif + #endif // If this is defined, the currently active mesh will be saved in the // current slot on M500. diff --git a/Marlin/src/config/examples/Mks/Sbase/Configuration_adv.h b/Marlin/src/config/examples/Mks/Sbase/Configuration_adv.h index f4123c704e..832dc49436 100644 --- a/Marlin/src/config/examples/Mks/Sbase/Configuration_adv.h +++ b/Marlin/src/config/examples/Mks/Sbase/Configuration_adv.h @@ -694,19 +694,71 @@ // @section leveling +#if ENABLED(DELTA) && !defined(DELTA_PROBEABLE_RADIUS) + #define DELTA_PROBEABLE_RADIUS DELTA_PRINTABLE_RADIUS +#elif IS_SCARA && !defined(SCARA_PRINTABLE_RADIUS) + #define SCARA_PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2) +#endif + // Default mesh area is an area with an inset margin on the print area. // Below are the macros that are used to define the borders for the mesh area, // made available here for specialized needs, ie dual extruder setup. #if ENABLED(MESH_BED_LEVELING) - #define MESH_MIN_X MESH_INSET - #define MESH_MAX_X (X_BED_SIZE - (MESH_INSET)) - #define MESH_MIN_Y MESH_INSET - #define MESH_MAX_Y (Y_BED_SIZE - (MESH_INSET)) + #if ENABLED(DELTA) + // 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 MESH_MIN_X (X_CENTER - (DELTA_PROBEABLE_RADIUS) + MESH_INSET) + #define MESH_MIN_Y (Y_CENTER - (DELTA_PROBEABLE_RADIUS) + MESH_INSET) + #define MESH_MAX_X (X_CENTER + DELTA_PROBEABLE_RADIUS - (MESH_INSET)) + #define MESH_MAX_Y (Y_CENTER + DELTA_PROBEABLE_RADIUS - (MESH_INSET)) + #elif IS_SCARA + #define MESH_MIN_X (X_CENTER - (SCARA_PRINTABLE_RADIUS) + MESH_INSET) + #define MESH_MIN_Y (Y_CENTER - (SCARA_PRINTABLE_RADIUS) + MESH_INSET) + #define MESH_MAX_X (X_CENTER + SCARA_PRINTABLE_RADIUS - (MESH_INSET)) + #define MESH_MAX_Y (Y_CENTER + SCARA_PRINTABLE_RADIUS - (MESH_INSET)) + #else + // Boundaries for Cartesian probing based on set limits + #if ENABLED(BED_CENTER_AT_0_0) + #define MESH_MIN_X (max(MESH_INSET, 0) - (X_BED_SIZE) / 2) + #define MESH_MIN_Y (max(MESH_INSET, 0) - (Y_BED_SIZE) / 2) + #define MESH_MAX_X (min(X_BED_SIZE - (MESH_INSET), X_BED_SIZE) - (X_BED_SIZE) / 2) + #define MESH_MAX_Y (min(Y_BED_SIZE - (MESH_INSET), Y_BED_SIZE) - (Y_BED_SIZE) / 2) + #else + #define MESH_MIN_X (max(X_MIN_POS + MESH_INSET, 0)) + #define MESH_MIN_Y (max(Y_MIN_POS + MESH_INSET, 0)) + #define MESH_MAX_X (min(X_MAX_POS - (MESH_INSET), X_BED_SIZE)) + #define MESH_MAX_Y (min(Y_MAX_POS - (MESH_INSET), Y_BED_SIZE)) + #endif + #endif #elif ENABLED(AUTO_BED_LEVELING_UBL) - #define UBL_MESH_MIN_X UBL_MESH_INSET - #define UBL_MESH_MAX_X (X_BED_SIZE - (UBL_MESH_INSET)) - #define UBL_MESH_MIN_Y UBL_MESH_INSET - #define UBL_MESH_MAX_Y (Y_BED_SIZE - (UBL_MESH_INSET)) + #if ENABLED(DELTA) + // 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 UBL_MESH_MIN_X (X_CENTER - (DELTA_PROBEABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MIN_Y (Y_CENTER - (DELTA_PROBEABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MAX_X (X_CENTER + DELTA_PROBEABLE_RADIUS - (UBL_MESH_INSET)) + #define UBL_MESH_MAX_Y (Y_CENTER + DELTA_PROBEABLE_RADIUS - (UBL_MESH_INSET)) + #elif IS_SCARA + #define UBL_MESH_MIN_X (X_CENTER - (SCARA_PRINTABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MIN_Y (Y_CENTER - (SCARA_PRINTABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MAX_X (X_CENTER + SCARA_PRINTABLE_RADIUS - (UBL_MESH_INSET)) + #define UBL_MESH_MAX_Y (Y_CENTER + SCARA_PRINTABLE_RADIUS - (UBL_MESH_INSET)) + #else + // Boundaries for Cartesian probing based on set limits + #if ENABLED(BED_CENTER_AT_0_0) + #define UBL_MESH_MIN_X (max(UBL_MESH_INSET, 0) - (X_BED_SIZE) / 2) + #define UBL_MESH_MIN_Y (max(UBL_MESH_INSET, 0) - (Y_BED_SIZE) / 2) + #define UBL_MESH_MAX_X (min(X_BED_SIZE - (UBL_MESH_INSET), X_BED_SIZE) - (X_BED_SIZE) / 2) + #define UBL_MESH_MAX_Y (min(Y_BED_SIZE - (UBL_MESH_INSET), Y_BED_SIZE) - (Y_BED_SIZE) / 2) + #else + #define UBL_MESH_MIN_X (max(X_MIN_POS + UBL_MESH_INSET, 0)) + #define UBL_MESH_MIN_Y (max(Y_MIN_POS + UBL_MESH_INSET, 0)) + #define UBL_MESH_MAX_X (min(X_MAX_POS - (UBL_MESH_INSET), X_BED_SIZE)) + #define UBL_MESH_MAX_Y (min(Y_MAX_POS - (UBL_MESH_INSET), Y_BED_SIZE)) + #endif + #endif // If this is defined, the currently active mesh will be saved in the // current slot on M500. diff --git a/Marlin/src/config/examples/RigidBot/Configuration_adv.h b/Marlin/src/config/examples/RigidBot/Configuration_adv.h index ea64ce7930..d7e5078fb7 100644 --- a/Marlin/src/config/examples/RigidBot/Configuration_adv.h +++ b/Marlin/src/config/examples/RigidBot/Configuration_adv.h @@ -673,19 +673,71 @@ // @section leveling +#if ENABLED(DELTA) && !defined(DELTA_PROBEABLE_RADIUS) + #define DELTA_PROBEABLE_RADIUS DELTA_PRINTABLE_RADIUS +#elif IS_SCARA && !defined(SCARA_PRINTABLE_RADIUS) + #define SCARA_PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2) +#endif + // Default mesh area is an area with an inset margin on the print area. // Below are the macros that are used to define the borders for the mesh area, // made available here for specialized needs, ie dual extruder setup. #if ENABLED(MESH_BED_LEVELING) - #define MESH_MIN_X MESH_INSET - #define MESH_MAX_X (X_BED_SIZE - (MESH_INSET)) - #define MESH_MIN_Y MESH_INSET - #define MESH_MAX_Y (Y_BED_SIZE - (MESH_INSET)) + #if ENABLED(DELTA) + // 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 MESH_MIN_X (X_CENTER - (DELTA_PROBEABLE_RADIUS) + MESH_INSET) + #define MESH_MIN_Y (Y_CENTER - (DELTA_PROBEABLE_RADIUS) + MESH_INSET) + #define MESH_MAX_X (X_CENTER + DELTA_PROBEABLE_RADIUS - (MESH_INSET)) + #define MESH_MAX_Y (Y_CENTER + DELTA_PROBEABLE_RADIUS - (MESH_INSET)) + #elif IS_SCARA + #define MESH_MIN_X (X_CENTER - (SCARA_PRINTABLE_RADIUS) + MESH_INSET) + #define MESH_MIN_Y (Y_CENTER - (SCARA_PRINTABLE_RADIUS) + MESH_INSET) + #define MESH_MAX_X (X_CENTER + SCARA_PRINTABLE_RADIUS - (MESH_INSET)) + #define MESH_MAX_Y (Y_CENTER + SCARA_PRINTABLE_RADIUS - (MESH_INSET)) + #else + // Boundaries for Cartesian probing based on set limits + #if ENABLED(BED_CENTER_AT_0_0) + #define MESH_MIN_X (max(MESH_INSET, 0) - (X_BED_SIZE) / 2) + #define MESH_MIN_Y (max(MESH_INSET, 0) - (Y_BED_SIZE) / 2) + #define MESH_MAX_X (min(X_BED_SIZE - (MESH_INSET), X_BED_SIZE) - (X_BED_SIZE) / 2) + #define MESH_MAX_Y (min(Y_BED_SIZE - (MESH_INSET), Y_BED_SIZE) - (Y_BED_SIZE) / 2) + #else + #define MESH_MIN_X (max(X_MIN_POS + MESH_INSET, 0)) + #define MESH_MIN_Y (max(Y_MIN_POS + MESH_INSET, 0)) + #define MESH_MAX_X (min(X_MAX_POS - (MESH_INSET), X_BED_SIZE)) + #define MESH_MAX_Y (min(Y_MAX_POS - (MESH_INSET), Y_BED_SIZE)) + #endif + #endif #elif ENABLED(AUTO_BED_LEVELING_UBL) - #define UBL_MESH_MIN_X UBL_MESH_INSET - #define UBL_MESH_MAX_X (X_BED_SIZE - (UBL_MESH_INSET)) - #define UBL_MESH_MIN_Y UBL_MESH_INSET - #define UBL_MESH_MAX_Y (Y_BED_SIZE - (UBL_MESH_INSET)) + #if ENABLED(DELTA) + // 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 UBL_MESH_MIN_X (X_CENTER - (DELTA_PROBEABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MIN_Y (Y_CENTER - (DELTA_PROBEABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MAX_X (X_CENTER + DELTA_PROBEABLE_RADIUS - (UBL_MESH_INSET)) + #define UBL_MESH_MAX_Y (Y_CENTER + DELTA_PROBEABLE_RADIUS - (UBL_MESH_INSET)) + #elif IS_SCARA + #define UBL_MESH_MIN_X (X_CENTER - (SCARA_PRINTABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MIN_Y (Y_CENTER - (SCARA_PRINTABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MAX_X (X_CENTER + SCARA_PRINTABLE_RADIUS - (UBL_MESH_INSET)) + #define UBL_MESH_MAX_Y (Y_CENTER + SCARA_PRINTABLE_RADIUS - (UBL_MESH_INSET)) + #else + // Boundaries for Cartesian probing based on set limits + #if ENABLED(BED_CENTER_AT_0_0) + #define UBL_MESH_MIN_X (max(UBL_MESH_INSET, 0) - (X_BED_SIZE) / 2) + #define UBL_MESH_MIN_Y (max(UBL_MESH_INSET, 0) - (Y_BED_SIZE) / 2) + #define UBL_MESH_MAX_X (min(X_BED_SIZE - (UBL_MESH_INSET), X_BED_SIZE) - (X_BED_SIZE) / 2) + #define UBL_MESH_MAX_Y (min(Y_BED_SIZE - (UBL_MESH_INSET), Y_BED_SIZE) - (Y_BED_SIZE) / 2) + #else + #define UBL_MESH_MIN_X (max(X_MIN_POS + UBL_MESH_INSET, 0)) + #define UBL_MESH_MIN_Y (max(Y_MIN_POS + UBL_MESH_INSET, 0)) + #define UBL_MESH_MAX_X (min(X_MAX_POS - (UBL_MESH_INSET), X_BED_SIZE)) + #define UBL_MESH_MAX_Y (min(Y_MAX_POS - (UBL_MESH_INSET), Y_BED_SIZE)) + #endif + #endif // If this is defined, the currently active mesh will be saved in the // current slot on M500. diff --git a/Marlin/src/config/examples/SCARA/Configuration_adv.h b/Marlin/src/config/examples/SCARA/Configuration_adv.h index 01e1eaafb8..42269860f9 100644 --- a/Marlin/src/config/examples/SCARA/Configuration_adv.h +++ b/Marlin/src/config/examples/SCARA/Configuration_adv.h @@ -673,19 +673,71 @@ // @section leveling +#if ENABLED(DELTA) && !defined(DELTA_PROBEABLE_RADIUS) + #define DELTA_PROBEABLE_RADIUS DELTA_PRINTABLE_RADIUS +#elif IS_SCARA && !defined(SCARA_PRINTABLE_RADIUS) + #define SCARA_PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2) +#endif + // Default mesh area is an area with an inset margin on the print area. // Below are the macros that are used to define the borders for the mesh area, // made available here for specialized needs, ie dual extruder setup. #if ENABLED(MESH_BED_LEVELING) - #define MESH_MIN_X MESH_INSET - #define MESH_MAX_X (X_BED_SIZE - (MESH_INSET)) - #define MESH_MIN_Y MESH_INSET - #define MESH_MAX_Y (Y_BED_SIZE - (MESH_INSET)) + #if ENABLED(DELTA) + // 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 MESH_MIN_X (X_CENTER - (DELTA_PROBEABLE_RADIUS) + MESH_INSET) + #define MESH_MIN_Y (Y_CENTER - (DELTA_PROBEABLE_RADIUS) + MESH_INSET) + #define MESH_MAX_X (X_CENTER + DELTA_PROBEABLE_RADIUS - (MESH_INSET)) + #define MESH_MAX_Y (Y_CENTER + DELTA_PROBEABLE_RADIUS - (MESH_INSET)) + #elif IS_SCARA + #define MESH_MIN_X (X_CENTER - (SCARA_PRINTABLE_RADIUS) + MESH_INSET) + #define MESH_MIN_Y (Y_CENTER - (SCARA_PRINTABLE_RADIUS) + MESH_INSET) + #define MESH_MAX_X (X_CENTER + SCARA_PRINTABLE_RADIUS - (MESH_INSET)) + #define MESH_MAX_Y (Y_CENTER + SCARA_PRINTABLE_RADIUS - (MESH_INSET)) + #else + // Boundaries for Cartesian probing based on set limits + #if ENABLED(BED_CENTER_AT_0_0) + #define MESH_MIN_X (max(MESH_INSET, 0) - (X_BED_SIZE) / 2) + #define MESH_MIN_Y (max(MESH_INSET, 0) - (Y_BED_SIZE) / 2) + #define MESH_MAX_X (min(X_BED_SIZE - (MESH_INSET), X_BED_SIZE) - (X_BED_SIZE) / 2) + #define MESH_MAX_Y (min(Y_BED_SIZE - (MESH_INSET), Y_BED_SIZE) - (Y_BED_SIZE) / 2) + #else + #define MESH_MIN_X (max(X_MIN_POS + MESH_INSET, 0)) + #define MESH_MIN_Y (max(Y_MIN_POS + MESH_INSET, 0)) + #define MESH_MAX_X (min(X_MAX_POS - (MESH_INSET), X_BED_SIZE)) + #define MESH_MAX_Y (min(Y_MAX_POS - (MESH_INSET), Y_BED_SIZE)) + #endif + #endif #elif ENABLED(AUTO_BED_LEVELING_UBL) - #define UBL_MESH_MIN_X UBL_MESH_INSET - #define UBL_MESH_MAX_X (X_BED_SIZE - (UBL_MESH_INSET)) - #define UBL_MESH_MIN_Y UBL_MESH_INSET - #define UBL_MESH_MAX_Y (Y_BED_SIZE - (UBL_MESH_INSET)) + #if ENABLED(DELTA) + // 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 UBL_MESH_MIN_X (X_CENTER - (DELTA_PROBEABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MIN_Y (Y_CENTER - (DELTA_PROBEABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MAX_X (X_CENTER + DELTA_PROBEABLE_RADIUS - (UBL_MESH_INSET)) + #define UBL_MESH_MAX_Y (Y_CENTER + DELTA_PROBEABLE_RADIUS - (UBL_MESH_INSET)) + #elif IS_SCARA + #define UBL_MESH_MIN_X (X_CENTER - (SCARA_PRINTABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MIN_Y (Y_CENTER - (SCARA_PRINTABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MAX_X (X_CENTER + SCARA_PRINTABLE_RADIUS - (UBL_MESH_INSET)) + #define UBL_MESH_MAX_Y (Y_CENTER + SCARA_PRINTABLE_RADIUS - (UBL_MESH_INSET)) + #else + // Boundaries for Cartesian probing based on set limits + #if ENABLED(BED_CENTER_AT_0_0) + #define UBL_MESH_MIN_X (max(UBL_MESH_INSET, 0) - (X_BED_SIZE) / 2) + #define UBL_MESH_MIN_Y (max(UBL_MESH_INSET, 0) - (Y_BED_SIZE) / 2) + #define UBL_MESH_MAX_X (min(X_BED_SIZE - (UBL_MESH_INSET), X_BED_SIZE) - (X_BED_SIZE) / 2) + #define UBL_MESH_MAX_Y (min(Y_BED_SIZE - (UBL_MESH_INSET), Y_BED_SIZE) - (Y_BED_SIZE) / 2) + #else + #define UBL_MESH_MIN_X (max(X_MIN_POS + UBL_MESH_INSET, 0)) + #define UBL_MESH_MIN_Y (max(Y_MIN_POS + UBL_MESH_INSET, 0)) + #define UBL_MESH_MAX_X (min(X_MAX_POS - (UBL_MESH_INSET), X_BED_SIZE)) + #define UBL_MESH_MAX_Y (min(Y_MAX_POS - (UBL_MESH_INSET), Y_BED_SIZE)) + #endif + #endif // If this is defined, the currently active mesh will be saved in the // current slot on M500. diff --git a/Marlin/src/config/examples/Sanguinololu/Configuration_adv.h b/Marlin/src/config/examples/Sanguinololu/Configuration_adv.h index 3b26cd6f11..981d67c9a1 100644 --- a/Marlin/src/config/examples/Sanguinololu/Configuration_adv.h +++ b/Marlin/src/config/examples/Sanguinololu/Configuration_adv.h @@ -662,19 +662,71 @@ // @section leveling +#if ENABLED(DELTA) && !defined(DELTA_PROBEABLE_RADIUS) + #define DELTA_PROBEABLE_RADIUS DELTA_PRINTABLE_RADIUS +#elif IS_SCARA && !defined(SCARA_PRINTABLE_RADIUS) + #define SCARA_PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2) +#endif + // Default mesh area is an area with an inset margin on the print area. // Below are the macros that are used to define the borders for the mesh area, // made available here for specialized needs, ie dual extruder setup. #if ENABLED(MESH_BED_LEVELING) - #define MESH_MIN_X MESH_INSET - #define MESH_MAX_X (X_BED_SIZE - (MESH_INSET)) - #define MESH_MIN_Y MESH_INSET - #define MESH_MAX_Y (Y_BED_SIZE - (MESH_INSET)) + #if ENABLED(DELTA) + // 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 MESH_MIN_X (X_CENTER - (DELTA_PROBEABLE_RADIUS) + MESH_INSET) + #define MESH_MIN_Y (Y_CENTER - (DELTA_PROBEABLE_RADIUS) + MESH_INSET) + #define MESH_MAX_X (X_CENTER + DELTA_PROBEABLE_RADIUS - (MESH_INSET)) + #define MESH_MAX_Y (Y_CENTER + DELTA_PROBEABLE_RADIUS - (MESH_INSET)) + #elif IS_SCARA + #define MESH_MIN_X (X_CENTER - (SCARA_PRINTABLE_RADIUS) + MESH_INSET) + #define MESH_MIN_Y (Y_CENTER - (SCARA_PRINTABLE_RADIUS) + MESH_INSET) + #define MESH_MAX_X (X_CENTER + SCARA_PRINTABLE_RADIUS - (MESH_INSET)) + #define MESH_MAX_Y (Y_CENTER + SCARA_PRINTABLE_RADIUS - (MESH_INSET)) + #else + // Boundaries for Cartesian probing based on set limits + #if ENABLED(BED_CENTER_AT_0_0) + #define MESH_MIN_X (max(MESH_INSET, 0) - (X_BED_SIZE) / 2) + #define MESH_MIN_Y (max(MESH_INSET, 0) - (Y_BED_SIZE) / 2) + #define MESH_MAX_X (min(X_BED_SIZE - (MESH_INSET), X_BED_SIZE) - (X_BED_SIZE) / 2) + #define MESH_MAX_Y (min(Y_BED_SIZE - (MESH_INSET), Y_BED_SIZE) - (Y_BED_SIZE) / 2) + #else + #define MESH_MIN_X (max(X_MIN_POS + MESH_INSET, 0)) + #define MESH_MIN_Y (max(Y_MIN_POS + MESH_INSET, 0)) + #define MESH_MAX_X (min(X_MAX_POS - (MESH_INSET), X_BED_SIZE)) + #define MESH_MAX_Y (min(Y_MAX_POS - (MESH_INSET), Y_BED_SIZE)) + #endif + #endif #elif ENABLED(AUTO_BED_LEVELING_UBL) - #define UBL_MESH_MIN_X UBL_MESH_INSET - #define UBL_MESH_MAX_X (X_BED_SIZE - (UBL_MESH_INSET)) - #define UBL_MESH_MIN_Y UBL_MESH_INSET - #define UBL_MESH_MAX_Y (Y_BED_SIZE - (UBL_MESH_INSET)) + #if ENABLED(DELTA) + // 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 UBL_MESH_MIN_X (X_CENTER - (DELTA_PROBEABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MIN_Y (Y_CENTER - (DELTA_PROBEABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MAX_X (X_CENTER + DELTA_PROBEABLE_RADIUS - (UBL_MESH_INSET)) + #define UBL_MESH_MAX_Y (Y_CENTER + DELTA_PROBEABLE_RADIUS - (UBL_MESH_INSET)) + #elif IS_SCARA + #define UBL_MESH_MIN_X (X_CENTER - (SCARA_PRINTABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MIN_Y (Y_CENTER - (SCARA_PRINTABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MAX_X (X_CENTER + SCARA_PRINTABLE_RADIUS - (UBL_MESH_INSET)) + #define UBL_MESH_MAX_Y (Y_CENTER + SCARA_PRINTABLE_RADIUS - (UBL_MESH_INSET)) + #else + // Boundaries for Cartesian probing based on set limits + #if ENABLED(BED_CENTER_AT_0_0) + #define UBL_MESH_MIN_X (max(UBL_MESH_INSET, 0) - (X_BED_SIZE) / 2) + #define UBL_MESH_MIN_Y (max(UBL_MESH_INSET, 0) - (Y_BED_SIZE) / 2) + #define UBL_MESH_MAX_X (min(X_BED_SIZE - (UBL_MESH_INSET), X_BED_SIZE) - (X_BED_SIZE) / 2) + #define UBL_MESH_MAX_Y (min(Y_BED_SIZE - (UBL_MESH_INSET), Y_BED_SIZE) - (Y_BED_SIZE) / 2) + #else + #define UBL_MESH_MIN_X (max(X_MIN_POS + UBL_MESH_INSET, 0)) + #define UBL_MESH_MIN_Y (max(Y_MIN_POS + UBL_MESH_INSET, 0)) + #define UBL_MESH_MAX_X (min(X_MAX_POS - (UBL_MESH_INSET), X_BED_SIZE)) + #define UBL_MESH_MAX_Y (min(Y_MAX_POS - (UBL_MESH_INSET), Y_BED_SIZE)) + #endif + #endif // If this is defined, the currently active mesh will be saved in the // current slot on M500. diff --git a/Marlin/src/config/examples/TinyBoy2/Configuration_adv.h b/Marlin/src/config/examples/TinyBoy2/Configuration_adv.h index 7a1c1376a8..f98f847beb 100644 --- a/Marlin/src/config/examples/TinyBoy2/Configuration_adv.h +++ b/Marlin/src/config/examples/TinyBoy2/Configuration_adv.h @@ -673,19 +673,71 @@ // @section leveling +#if ENABLED(DELTA) && !defined(DELTA_PROBEABLE_RADIUS) + #define DELTA_PROBEABLE_RADIUS DELTA_PRINTABLE_RADIUS +#elif IS_SCARA && !defined(SCARA_PRINTABLE_RADIUS) + #define SCARA_PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2) +#endif + // Default mesh area is an area with an inset margin on the print area. // Below are the macros that are used to define the borders for the mesh area, // made available here for specialized needs, ie dual extruder setup. #if ENABLED(MESH_BED_LEVELING) - #define MESH_MIN_X MESH_INSET - #define MESH_MAX_X (X_BED_SIZE - (MESH_INSET)) - #define MESH_MIN_Y MESH_INSET - #define MESH_MAX_Y (Y_BED_SIZE - (MESH_INSET)) + #if ENABLED(DELTA) + // 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 MESH_MIN_X (X_CENTER - (DELTA_PROBEABLE_RADIUS) + MESH_INSET) + #define MESH_MIN_Y (Y_CENTER - (DELTA_PROBEABLE_RADIUS) + MESH_INSET) + #define MESH_MAX_X (X_CENTER + DELTA_PROBEABLE_RADIUS - (MESH_INSET)) + #define MESH_MAX_Y (Y_CENTER + DELTA_PROBEABLE_RADIUS - (MESH_INSET)) + #elif IS_SCARA + #define MESH_MIN_X (X_CENTER - (SCARA_PRINTABLE_RADIUS) + MESH_INSET) + #define MESH_MIN_Y (Y_CENTER - (SCARA_PRINTABLE_RADIUS) + MESH_INSET) + #define MESH_MAX_X (X_CENTER + SCARA_PRINTABLE_RADIUS - (MESH_INSET)) + #define MESH_MAX_Y (Y_CENTER + SCARA_PRINTABLE_RADIUS - (MESH_INSET)) + #else + // Boundaries for Cartesian probing based on set limits + #if ENABLED(BED_CENTER_AT_0_0) + #define MESH_MIN_X (max(MESH_INSET, 0) - (X_BED_SIZE) / 2) + #define MESH_MIN_Y (max(MESH_INSET, 0) - (Y_BED_SIZE) / 2) + #define MESH_MAX_X (min(X_BED_SIZE - (MESH_INSET), X_BED_SIZE) - (X_BED_SIZE) / 2) + #define MESH_MAX_Y (min(Y_BED_SIZE - (MESH_INSET), Y_BED_SIZE) - (Y_BED_SIZE) / 2) + #else + #define MESH_MIN_X (max(X_MIN_POS + MESH_INSET, 0)) + #define MESH_MIN_Y (max(Y_MIN_POS + MESH_INSET, 0)) + #define MESH_MAX_X (min(X_MAX_POS - (MESH_INSET), X_BED_SIZE)) + #define MESH_MAX_Y (min(Y_MAX_POS - (MESH_INSET), Y_BED_SIZE)) + #endif + #endif #elif ENABLED(AUTO_BED_LEVELING_UBL) - #define UBL_MESH_MIN_X UBL_MESH_INSET - #define UBL_MESH_MAX_X (X_BED_SIZE - (UBL_MESH_INSET)) - #define UBL_MESH_MIN_Y UBL_MESH_INSET - #define UBL_MESH_MAX_Y (Y_BED_SIZE - (UBL_MESH_INSET)) + #if ENABLED(DELTA) + // 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 UBL_MESH_MIN_X (X_CENTER - (DELTA_PROBEABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MIN_Y (Y_CENTER - (DELTA_PROBEABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MAX_X (X_CENTER + DELTA_PROBEABLE_RADIUS - (UBL_MESH_INSET)) + #define UBL_MESH_MAX_Y (Y_CENTER + DELTA_PROBEABLE_RADIUS - (UBL_MESH_INSET)) + #elif IS_SCARA + #define UBL_MESH_MIN_X (X_CENTER - (SCARA_PRINTABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MIN_Y (Y_CENTER - (SCARA_PRINTABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MAX_X (X_CENTER + SCARA_PRINTABLE_RADIUS - (UBL_MESH_INSET)) + #define UBL_MESH_MAX_Y (Y_CENTER + SCARA_PRINTABLE_RADIUS - (UBL_MESH_INSET)) + #else + // Boundaries for Cartesian probing based on set limits + #if ENABLED(BED_CENTER_AT_0_0) + #define UBL_MESH_MIN_X (max(UBL_MESH_INSET, 0) - (X_BED_SIZE) / 2) + #define UBL_MESH_MIN_Y (max(UBL_MESH_INSET, 0) - (Y_BED_SIZE) / 2) + #define UBL_MESH_MAX_X (min(X_BED_SIZE - (UBL_MESH_INSET), X_BED_SIZE) - (X_BED_SIZE) / 2) + #define UBL_MESH_MAX_Y (min(Y_BED_SIZE - (UBL_MESH_INSET), Y_BED_SIZE) - (Y_BED_SIZE) / 2) + #else + #define UBL_MESH_MIN_X (max(X_MIN_POS + UBL_MESH_INSET, 0)) + #define UBL_MESH_MIN_Y (max(Y_MIN_POS + UBL_MESH_INSET, 0)) + #define UBL_MESH_MAX_X (min(X_MAX_POS - (UBL_MESH_INSET), X_BED_SIZE)) + #define UBL_MESH_MAX_Y (min(Y_MAX_POS - (UBL_MESH_INSET), Y_BED_SIZE)) + #endif + #endif // If this is defined, the currently active mesh will be saved in the // current slot on M500. diff --git a/Marlin/src/config/examples/Velleman/K8200/Configuration_adv.h b/Marlin/src/config/examples/Velleman/K8200/Configuration_adv.h index 95914697cd..e9348dfc38 100644 --- a/Marlin/src/config/examples/Velleman/K8200/Configuration_adv.h +++ b/Marlin/src/config/examples/Velleman/K8200/Configuration_adv.h @@ -683,19 +683,71 @@ // @section leveling +#if ENABLED(DELTA) && !defined(DELTA_PROBEABLE_RADIUS) + #define DELTA_PROBEABLE_RADIUS DELTA_PRINTABLE_RADIUS +#elif IS_SCARA && !defined(SCARA_PRINTABLE_RADIUS) + #define SCARA_PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2) +#endif + // Default mesh area is an area with an inset margin on the print area. // Below are the macros that are used to define the borders for the mesh area, // made available here for specialized needs, ie dual extruder setup. #if ENABLED(MESH_BED_LEVELING) - #define MESH_MIN_X MESH_INSET - #define MESH_MAX_X (X_BED_SIZE - (MESH_INSET)) - #define MESH_MIN_Y MESH_INSET - #define MESH_MAX_Y (Y_BED_SIZE - (MESH_INSET)) + #if ENABLED(DELTA) + // 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 MESH_MIN_X (X_CENTER - (DELTA_PROBEABLE_RADIUS) + MESH_INSET) + #define MESH_MIN_Y (Y_CENTER - (DELTA_PROBEABLE_RADIUS) + MESH_INSET) + #define MESH_MAX_X (X_CENTER + DELTA_PROBEABLE_RADIUS - (MESH_INSET)) + #define MESH_MAX_Y (Y_CENTER + DELTA_PROBEABLE_RADIUS - (MESH_INSET)) + #elif IS_SCARA + #define MESH_MIN_X (X_CENTER - (SCARA_PRINTABLE_RADIUS) + MESH_INSET) + #define MESH_MIN_Y (Y_CENTER - (SCARA_PRINTABLE_RADIUS) + MESH_INSET) + #define MESH_MAX_X (X_CENTER + SCARA_PRINTABLE_RADIUS - (MESH_INSET)) + #define MESH_MAX_Y (Y_CENTER + SCARA_PRINTABLE_RADIUS - (MESH_INSET)) + #else + // Boundaries for Cartesian probing based on set limits + #if ENABLED(BED_CENTER_AT_0_0) + #define MESH_MIN_X (max(MESH_INSET, 0) - (X_BED_SIZE) / 2) + #define MESH_MIN_Y (max(MESH_INSET, 0) - (Y_BED_SIZE) / 2) + #define MESH_MAX_X (min(X_BED_SIZE - (MESH_INSET), X_BED_SIZE) - (X_BED_SIZE) / 2) + #define MESH_MAX_Y (min(Y_BED_SIZE - (MESH_INSET), Y_BED_SIZE) - (Y_BED_SIZE) / 2) + #else + #define MESH_MIN_X (max(X_MIN_POS + MESH_INSET, 0)) + #define MESH_MIN_Y (max(Y_MIN_POS + MESH_INSET, 0)) + #define MESH_MAX_X (min(X_MAX_POS - (MESH_INSET), X_BED_SIZE)) + #define MESH_MAX_Y (min(Y_MAX_POS - (MESH_INSET), Y_BED_SIZE)) + #endif + #endif #elif ENABLED(AUTO_BED_LEVELING_UBL) - #define UBL_MESH_MIN_X UBL_MESH_INSET - #define UBL_MESH_MAX_X (X_BED_SIZE - (UBL_MESH_INSET)) - #define UBL_MESH_MIN_Y UBL_MESH_INSET - #define UBL_MESH_MAX_Y (Y_BED_SIZE - (UBL_MESH_INSET)) + #if ENABLED(DELTA) + // 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 UBL_MESH_MIN_X (X_CENTER - (DELTA_PROBEABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MIN_Y (Y_CENTER - (DELTA_PROBEABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MAX_X (X_CENTER + DELTA_PROBEABLE_RADIUS - (UBL_MESH_INSET)) + #define UBL_MESH_MAX_Y (Y_CENTER + DELTA_PROBEABLE_RADIUS - (UBL_MESH_INSET)) + #elif IS_SCARA + #define UBL_MESH_MIN_X (X_CENTER - (SCARA_PRINTABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MIN_Y (Y_CENTER - (SCARA_PRINTABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MAX_X (X_CENTER + SCARA_PRINTABLE_RADIUS - (UBL_MESH_INSET)) + #define UBL_MESH_MAX_Y (Y_CENTER + SCARA_PRINTABLE_RADIUS - (UBL_MESH_INSET)) + #else + // Boundaries for Cartesian probing based on set limits + #if ENABLED(BED_CENTER_AT_0_0) + #define UBL_MESH_MIN_X (max(UBL_MESH_INSET, 0) - (X_BED_SIZE) / 2) + #define UBL_MESH_MIN_Y (max(UBL_MESH_INSET, 0) - (Y_BED_SIZE) / 2) + #define UBL_MESH_MAX_X (min(X_BED_SIZE - (UBL_MESH_INSET), X_BED_SIZE) - (X_BED_SIZE) / 2) + #define UBL_MESH_MAX_Y (min(Y_BED_SIZE - (UBL_MESH_INSET), Y_BED_SIZE) - (Y_BED_SIZE) / 2) + #else + #define UBL_MESH_MIN_X (max(X_MIN_POS + UBL_MESH_INSET, 0)) + #define UBL_MESH_MIN_Y (max(Y_MIN_POS + UBL_MESH_INSET, 0)) + #define UBL_MESH_MAX_X (min(X_MAX_POS - (UBL_MESH_INSET), X_BED_SIZE)) + #define UBL_MESH_MAX_Y (min(Y_MAX_POS - (UBL_MESH_INSET), Y_BED_SIZE)) + #endif + #endif // If this is defined, the currently active mesh will be saved in the // current slot on M500. diff --git a/Marlin/src/config/examples/Velleman/K8400/Configuration_adv.h b/Marlin/src/config/examples/Velleman/K8400/Configuration_adv.h index d8f7e85460..17a73a6ee2 100644 --- a/Marlin/src/config/examples/Velleman/K8400/Configuration_adv.h +++ b/Marlin/src/config/examples/Velleman/K8400/Configuration_adv.h @@ -673,19 +673,71 @@ // @section leveling +#if ENABLED(DELTA) && !defined(DELTA_PROBEABLE_RADIUS) + #define DELTA_PROBEABLE_RADIUS DELTA_PRINTABLE_RADIUS +#elif IS_SCARA && !defined(SCARA_PRINTABLE_RADIUS) + #define SCARA_PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2) +#endif + // Default mesh area is an area with an inset margin on the print area. // Below are the macros that are used to define the borders for the mesh area, // made available here for specialized needs, ie dual extruder setup. #if ENABLED(MESH_BED_LEVELING) - #define MESH_MIN_X MESH_INSET - #define MESH_MAX_X (X_BED_SIZE - (MESH_INSET)) - #define MESH_MIN_Y MESH_INSET - #define MESH_MAX_Y (Y_BED_SIZE - (MESH_INSET)) + #if ENABLED(DELTA) + // 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 MESH_MIN_X (X_CENTER - (DELTA_PROBEABLE_RADIUS) + MESH_INSET) + #define MESH_MIN_Y (Y_CENTER - (DELTA_PROBEABLE_RADIUS) + MESH_INSET) + #define MESH_MAX_X (X_CENTER + DELTA_PROBEABLE_RADIUS - (MESH_INSET)) + #define MESH_MAX_Y (Y_CENTER + DELTA_PROBEABLE_RADIUS - (MESH_INSET)) + #elif IS_SCARA + #define MESH_MIN_X (X_CENTER - (SCARA_PRINTABLE_RADIUS) + MESH_INSET) + #define MESH_MIN_Y (Y_CENTER - (SCARA_PRINTABLE_RADIUS) + MESH_INSET) + #define MESH_MAX_X (X_CENTER + SCARA_PRINTABLE_RADIUS - (MESH_INSET)) + #define MESH_MAX_Y (Y_CENTER + SCARA_PRINTABLE_RADIUS - (MESH_INSET)) + #else + // Boundaries for Cartesian probing based on set limits + #if ENABLED(BED_CENTER_AT_0_0) + #define MESH_MIN_X (max(MESH_INSET, 0) - (X_BED_SIZE) / 2) + #define MESH_MIN_Y (max(MESH_INSET, 0) - (Y_BED_SIZE) / 2) + #define MESH_MAX_X (min(X_BED_SIZE - (MESH_INSET), X_BED_SIZE) - (X_BED_SIZE) / 2) + #define MESH_MAX_Y (min(Y_BED_SIZE - (MESH_INSET), Y_BED_SIZE) - (Y_BED_SIZE) / 2) + #else + #define MESH_MIN_X (max(X_MIN_POS + MESH_INSET, 0)) + #define MESH_MIN_Y (max(Y_MIN_POS + MESH_INSET, 0)) + #define MESH_MAX_X (min(X_MAX_POS - (MESH_INSET), X_BED_SIZE)) + #define MESH_MAX_Y (min(Y_MAX_POS - (MESH_INSET), Y_BED_SIZE)) + #endif + #endif #elif ENABLED(AUTO_BED_LEVELING_UBL) - #define UBL_MESH_MIN_X UBL_MESH_INSET - #define UBL_MESH_MAX_X (X_BED_SIZE - (UBL_MESH_INSET)) - #define UBL_MESH_MIN_Y UBL_MESH_INSET - #define UBL_MESH_MAX_Y (Y_BED_SIZE - (UBL_MESH_INSET)) + #if ENABLED(DELTA) + // 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 UBL_MESH_MIN_X (X_CENTER - (DELTA_PROBEABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MIN_Y (Y_CENTER - (DELTA_PROBEABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MAX_X (X_CENTER + DELTA_PROBEABLE_RADIUS - (UBL_MESH_INSET)) + #define UBL_MESH_MAX_Y (Y_CENTER + DELTA_PROBEABLE_RADIUS - (UBL_MESH_INSET)) + #elif IS_SCARA + #define UBL_MESH_MIN_X (X_CENTER - (SCARA_PRINTABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MIN_Y (Y_CENTER - (SCARA_PRINTABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MAX_X (X_CENTER + SCARA_PRINTABLE_RADIUS - (UBL_MESH_INSET)) + #define UBL_MESH_MAX_Y (Y_CENTER + SCARA_PRINTABLE_RADIUS - (UBL_MESH_INSET)) + #else + // Boundaries for Cartesian probing based on set limits + #if ENABLED(BED_CENTER_AT_0_0) + #define UBL_MESH_MIN_X (max(UBL_MESH_INSET, 0) - (X_BED_SIZE) / 2) + #define UBL_MESH_MIN_Y (max(UBL_MESH_INSET, 0) - (Y_BED_SIZE) / 2) + #define UBL_MESH_MAX_X (min(X_BED_SIZE - (UBL_MESH_INSET), X_BED_SIZE) - (X_BED_SIZE) / 2) + #define UBL_MESH_MAX_Y (min(Y_BED_SIZE - (UBL_MESH_INSET), Y_BED_SIZE) - (Y_BED_SIZE) / 2) + #else + #define UBL_MESH_MIN_X (max(X_MIN_POS + UBL_MESH_INSET, 0)) + #define UBL_MESH_MIN_Y (max(Y_MIN_POS + UBL_MESH_INSET, 0)) + #define UBL_MESH_MAX_X (min(X_MAX_POS - (UBL_MESH_INSET), X_BED_SIZE)) + #define UBL_MESH_MAX_Y (min(Y_MAX_POS - (UBL_MESH_INSET), Y_BED_SIZE)) + #endif + #endif // If this is defined, the currently active mesh will be saved in the // current slot on M500. diff --git a/Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h b/Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h index 40dc3cfb11..65dead1a86 100644 --- a/Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h @@ -675,19 +675,71 @@ // @section leveling +#if ENABLED(DELTA) && !defined(DELTA_PROBEABLE_RADIUS) + #define DELTA_PROBEABLE_RADIUS DELTA_PRINTABLE_RADIUS +#elif IS_SCARA && !defined(SCARA_PRINTABLE_RADIUS) + #define SCARA_PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2) +#endif + // Default mesh area is an area with an inset margin on the print area. // Below are the macros that are used to define the borders for the mesh area, // made available here for specialized needs, ie dual extruder setup. #if ENABLED(MESH_BED_LEVELING) - #define MESH_MIN_X MESH_INSET - #define MESH_MAX_X (X_BED_SIZE - (MESH_INSET)) - #define MESH_MIN_Y MESH_INSET - #define MESH_MAX_Y (Y_BED_SIZE - (MESH_INSET)) + #if ENABLED(DELTA) + // 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 MESH_MIN_X (X_CENTER - (DELTA_PROBEABLE_RADIUS) + MESH_INSET) + #define MESH_MIN_Y (Y_CENTER - (DELTA_PROBEABLE_RADIUS) + MESH_INSET) + #define MESH_MAX_X (X_CENTER + DELTA_PROBEABLE_RADIUS - (MESH_INSET)) + #define MESH_MAX_Y (Y_CENTER + DELTA_PROBEABLE_RADIUS - (MESH_INSET)) + #elif IS_SCARA + #define MESH_MIN_X (X_CENTER - (SCARA_PRINTABLE_RADIUS) + MESH_INSET) + #define MESH_MIN_Y (Y_CENTER - (SCARA_PRINTABLE_RADIUS) + MESH_INSET) + #define MESH_MAX_X (X_CENTER + SCARA_PRINTABLE_RADIUS - (MESH_INSET)) + #define MESH_MAX_Y (Y_CENTER + SCARA_PRINTABLE_RADIUS - (MESH_INSET)) + #else + // Boundaries for Cartesian probing based on set limits + #if ENABLED(BED_CENTER_AT_0_0) + #define MESH_MIN_X (max(MESH_INSET, 0) - (X_BED_SIZE) / 2) + #define MESH_MIN_Y (max(MESH_INSET, 0) - (Y_BED_SIZE) / 2) + #define MESH_MAX_X (min(X_BED_SIZE - (MESH_INSET), X_BED_SIZE) - (X_BED_SIZE) / 2) + #define MESH_MAX_Y (min(Y_BED_SIZE - (MESH_INSET), Y_BED_SIZE) - (Y_BED_SIZE) / 2) + #else + #define MESH_MIN_X (max(X_MIN_POS + MESH_INSET, 0)) + #define MESH_MIN_Y (max(Y_MIN_POS + MESH_INSET, 0)) + #define MESH_MAX_X (min(X_MAX_POS - (MESH_INSET), X_BED_SIZE)) + #define MESH_MAX_Y (min(Y_MAX_POS - (MESH_INSET), Y_BED_SIZE)) + #endif + #endif #elif ENABLED(AUTO_BED_LEVELING_UBL) - #define UBL_MESH_MIN_X UBL_MESH_INSET - #define UBL_MESH_MAX_X (X_BED_SIZE - (UBL_MESH_INSET)) - #define UBL_MESH_MIN_Y UBL_MESH_INSET - #define UBL_MESH_MAX_Y (Y_BED_SIZE - (UBL_MESH_INSET)) + #if ENABLED(DELTA) + // 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 UBL_MESH_MIN_X (X_CENTER - (DELTA_PROBEABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MIN_Y (Y_CENTER - (DELTA_PROBEABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MAX_X (X_CENTER + DELTA_PROBEABLE_RADIUS - (UBL_MESH_INSET)) + #define UBL_MESH_MAX_Y (Y_CENTER + DELTA_PROBEABLE_RADIUS - (UBL_MESH_INSET)) + #elif IS_SCARA + #define UBL_MESH_MIN_X (X_CENTER - (SCARA_PRINTABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MIN_Y (Y_CENTER - (SCARA_PRINTABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MAX_X (X_CENTER + SCARA_PRINTABLE_RADIUS - (UBL_MESH_INSET)) + #define UBL_MESH_MAX_Y (Y_CENTER + SCARA_PRINTABLE_RADIUS - (UBL_MESH_INSET)) + #else + // Boundaries for Cartesian probing based on set limits + #if ENABLED(BED_CENTER_AT_0_0) + #define UBL_MESH_MIN_X (max(UBL_MESH_INSET, 0) - (X_BED_SIZE) / 2) + #define UBL_MESH_MIN_Y (max(UBL_MESH_INSET, 0) - (Y_BED_SIZE) / 2) + #define UBL_MESH_MAX_X (min(X_BED_SIZE - (UBL_MESH_INSET), X_BED_SIZE) - (X_BED_SIZE) / 2) + #define UBL_MESH_MAX_Y (min(Y_BED_SIZE - (UBL_MESH_INSET), Y_BED_SIZE) - (Y_BED_SIZE) / 2) + #else + #define UBL_MESH_MIN_X (max(X_MIN_POS + UBL_MESH_INSET, 0)) + #define UBL_MESH_MIN_Y (max(Y_MIN_POS + UBL_MESH_INSET, 0)) + #define UBL_MESH_MAX_X (min(X_MAX_POS - (UBL_MESH_INSET), X_BED_SIZE)) + #define UBL_MESH_MAX_Y (min(Y_MAX_POS - (UBL_MESH_INSET), Y_BED_SIZE)) + #endif + #endif // If this is defined, the currently active mesh will be saved in the // current slot on M500. diff --git a/Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h b/Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h index b6f763372c..84e9998605 100644 --- a/Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h @@ -675,19 +675,71 @@ // @section leveling +#if ENABLED(DELTA) && !defined(DELTA_PROBEABLE_RADIUS) + #define DELTA_PROBEABLE_RADIUS DELTA_PRINTABLE_RADIUS +#elif IS_SCARA && !defined(SCARA_PRINTABLE_RADIUS) + #define SCARA_PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2) +#endif + // Default mesh area is an area with an inset margin on the print area. // Below are the macros that are used to define the borders for the mesh area, // made available here for specialized needs, ie dual extruder setup. #if ENABLED(MESH_BED_LEVELING) - #define MESH_MIN_X MESH_INSET - #define MESH_MAX_X (X_BED_SIZE - (MESH_INSET)) - #define MESH_MIN_Y MESH_INSET - #define MESH_MAX_Y (Y_BED_SIZE - (MESH_INSET)) + #if ENABLED(DELTA) + // 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 MESH_MIN_X (X_CENTER - (DELTA_PROBEABLE_RADIUS) + MESH_INSET) + #define MESH_MIN_Y (Y_CENTER - (DELTA_PROBEABLE_RADIUS) + MESH_INSET) + #define MESH_MAX_X (X_CENTER + DELTA_PROBEABLE_RADIUS - (MESH_INSET)) + #define MESH_MAX_Y (Y_CENTER + DELTA_PROBEABLE_RADIUS - (MESH_INSET)) + #elif IS_SCARA + #define MESH_MIN_X (X_CENTER - (SCARA_PRINTABLE_RADIUS) + MESH_INSET) + #define MESH_MIN_Y (Y_CENTER - (SCARA_PRINTABLE_RADIUS) + MESH_INSET) + #define MESH_MAX_X (X_CENTER + SCARA_PRINTABLE_RADIUS - (MESH_INSET)) + #define MESH_MAX_Y (Y_CENTER + SCARA_PRINTABLE_RADIUS - (MESH_INSET)) + #else + // Boundaries for Cartesian probing based on set limits + #if ENABLED(BED_CENTER_AT_0_0) + #define MESH_MIN_X (max(MESH_INSET, 0) - (X_BED_SIZE) / 2) + #define MESH_MIN_Y (max(MESH_INSET, 0) - (Y_BED_SIZE) / 2) + #define MESH_MAX_X (min(X_BED_SIZE - (MESH_INSET), X_BED_SIZE) - (X_BED_SIZE) / 2) + #define MESH_MAX_Y (min(Y_BED_SIZE - (MESH_INSET), Y_BED_SIZE) - (Y_BED_SIZE) / 2) + #else + #define MESH_MIN_X (max(X_MIN_POS + MESH_INSET, 0)) + #define MESH_MIN_Y (max(Y_MIN_POS + MESH_INSET, 0)) + #define MESH_MAX_X (min(X_MAX_POS - (MESH_INSET), X_BED_SIZE)) + #define MESH_MAX_Y (min(Y_MAX_POS - (MESH_INSET), Y_BED_SIZE)) + #endif + #endif #elif ENABLED(AUTO_BED_LEVELING_UBL) - #define UBL_MESH_MIN_X UBL_MESH_INSET - #define UBL_MESH_MAX_X (X_BED_SIZE - (UBL_MESH_INSET)) - #define UBL_MESH_MIN_Y UBL_MESH_INSET - #define UBL_MESH_MAX_Y (Y_BED_SIZE - (UBL_MESH_INSET)) + #if ENABLED(DELTA) + // 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 UBL_MESH_MIN_X (X_CENTER - (DELTA_PROBEABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MIN_Y (Y_CENTER - (DELTA_PROBEABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MAX_X (X_CENTER + DELTA_PROBEABLE_RADIUS - (UBL_MESH_INSET)) + #define UBL_MESH_MAX_Y (Y_CENTER + DELTA_PROBEABLE_RADIUS - (UBL_MESH_INSET)) + #elif IS_SCARA + #define UBL_MESH_MIN_X (X_CENTER - (SCARA_PRINTABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MIN_Y (Y_CENTER - (SCARA_PRINTABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MAX_X (X_CENTER + SCARA_PRINTABLE_RADIUS - (UBL_MESH_INSET)) + #define UBL_MESH_MAX_Y (Y_CENTER + SCARA_PRINTABLE_RADIUS - (UBL_MESH_INSET)) + #else + // Boundaries for Cartesian probing based on set limits + #if ENABLED(BED_CENTER_AT_0_0) + #define UBL_MESH_MIN_X (max(UBL_MESH_INSET, 0) - (X_BED_SIZE) / 2) + #define UBL_MESH_MIN_Y (max(UBL_MESH_INSET, 0) - (Y_BED_SIZE) / 2) + #define UBL_MESH_MAX_X (min(X_BED_SIZE - (UBL_MESH_INSET), X_BED_SIZE) - (X_BED_SIZE) / 2) + #define UBL_MESH_MAX_Y (min(Y_BED_SIZE - (UBL_MESH_INSET), Y_BED_SIZE) - (Y_BED_SIZE) / 2) + #else + #define UBL_MESH_MIN_X (max(X_MIN_POS + UBL_MESH_INSET, 0)) + #define UBL_MESH_MIN_Y (max(Y_MIN_POS + UBL_MESH_INSET, 0)) + #define UBL_MESH_MAX_X (min(X_MAX_POS - (UBL_MESH_INSET), X_BED_SIZE)) + #define UBL_MESH_MAX_Y (min(Y_MAX_POS - (UBL_MESH_INSET), Y_BED_SIZE)) + #endif + #endif // If this is defined, the currently active mesh will be saved in the // current slot on M500. diff --git a/Marlin/src/config/examples/delta/generic/Configuration_adv.h b/Marlin/src/config/examples/delta/generic/Configuration_adv.h index b6f763372c..84e9998605 100644 --- a/Marlin/src/config/examples/delta/generic/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/generic/Configuration_adv.h @@ -675,19 +675,71 @@ // @section leveling +#if ENABLED(DELTA) && !defined(DELTA_PROBEABLE_RADIUS) + #define DELTA_PROBEABLE_RADIUS DELTA_PRINTABLE_RADIUS +#elif IS_SCARA && !defined(SCARA_PRINTABLE_RADIUS) + #define SCARA_PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2) +#endif + // Default mesh area is an area with an inset margin on the print area. // Below are the macros that are used to define the borders for the mesh area, // made available here for specialized needs, ie dual extruder setup. #if ENABLED(MESH_BED_LEVELING) - #define MESH_MIN_X MESH_INSET - #define MESH_MAX_X (X_BED_SIZE - (MESH_INSET)) - #define MESH_MIN_Y MESH_INSET - #define MESH_MAX_Y (Y_BED_SIZE - (MESH_INSET)) + #if ENABLED(DELTA) + // 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 MESH_MIN_X (X_CENTER - (DELTA_PROBEABLE_RADIUS) + MESH_INSET) + #define MESH_MIN_Y (Y_CENTER - (DELTA_PROBEABLE_RADIUS) + MESH_INSET) + #define MESH_MAX_X (X_CENTER + DELTA_PROBEABLE_RADIUS - (MESH_INSET)) + #define MESH_MAX_Y (Y_CENTER + DELTA_PROBEABLE_RADIUS - (MESH_INSET)) + #elif IS_SCARA + #define MESH_MIN_X (X_CENTER - (SCARA_PRINTABLE_RADIUS) + MESH_INSET) + #define MESH_MIN_Y (Y_CENTER - (SCARA_PRINTABLE_RADIUS) + MESH_INSET) + #define MESH_MAX_X (X_CENTER + SCARA_PRINTABLE_RADIUS - (MESH_INSET)) + #define MESH_MAX_Y (Y_CENTER + SCARA_PRINTABLE_RADIUS - (MESH_INSET)) + #else + // Boundaries for Cartesian probing based on set limits + #if ENABLED(BED_CENTER_AT_0_0) + #define MESH_MIN_X (max(MESH_INSET, 0) - (X_BED_SIZE) / 2) + #define MESH_MIN_Y (max(MESH_INSET, 0) - (Y_BED_SIZE) / 2) + #define MESH_MAX_X (min(X_BED_SIZE - (MESH_INSET), X_BED_SIZE) - (X_BED_SIZE) / 2) + #define MESH_MAX_Y (min(Y_BED_SIZE - (MESH_INSET), Y_BED_SIZE) - (Y_BED_SIZE) / 2) + #else + #define MESH_MIN_X (max(X_MIN_POS + MESH_INSET, 0)) + #define MESH_MIN_Y (max(Y_MIN_POS + MESH_INSET, 0)) + #define MESH_MAX_X (min(X_MAX_POS - (MESH_INSET), X_BED_SIZE)) + #define MESH_MAX_Y (min(Y_MAX_POS - (MESH_INSET), Y_BED_SIZE)) + #endif + #endif #elif ENABLED(AUTO_BED_LEVELING_UBL) - #define UBL_MESH_MIN_X UBL_MESH_INSET - #define UBL_MESH_MAX_X (X_BED_SIZE - (UBL_MESH_INSET)) - #define UBL_MESH_MIN_Y UBL_MESH_INSET - #define UBL_MESH_MAX_Y (Y_BED_SIZE - (UBL_MESH_INSET)) + #if ENABLED(DELTA) + // 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 UBL_MESH_MIN_X (X_CENTER - (DELTA_PROBEABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MIN_Y (Y_CENTER - (DELTA_PROBEABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MAX_X (X_CENTER + DELTA_PROBEABLE_RADIUS - (UBL_MESH_INSET)) + #define UBL_MESH_MAX_Y (Y_CENTER + DELTA_PROBEABLE_RADIUS - (UBL_MESH_INSET)) + #elif IS_SCARA + #define UBL_MESH_MIN_X (X_CENTER - (SCARA_PRINTABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MIN_Y (Y_CENTER - (SCARA_PRINTABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MAX_X (X_CENTER + SCARA_PRINTABLE_RADIUS - (UBL_MESH_INSET)) + #define UBL_MESH_MAX_Y (Y_CENTER + SCARA_PRINTABLE_RADIUS - (UBL_MESH_INSET)) + #else + // Boundaries for Cartesian probing based on set limits + #if ENABLED(BED_CENTER_AT_0_0) + #define UBL_MESH_MIN_X (max(UBL_MESH_INSET, 0) - (X_BED_SIZE) / 2) + #define UBL_MESH_MIN_Y (max(UBL_MESH_INSET, 0) - (Y_BED_SIZE) / 2) + #define UBL_MESH_MAX_X (min(X_BED_SIZE - (UBL_MESH_INSET), X_BED_SIZE) - (X_BED_SIZE) / 2) + #define UBL_MESH_MAX_Y (min(Y_BED_SIZE - (UBL_MESH_INSET), Y_BED_SIZE) - (Y_BED_SIZE) / 2) + #else + #define UBL_MESH_MIN_X (max(X_MIN_POS + UBL_MESH_INSET, 0)) + #define UBL_MESH_MIN_Y (max(Y_MIN_POS + UBL_MESH_INSET, 0)) + #define UBL_MESH_MAX_X (min(X_MAX_POS - (UBL_MESH_INSET), X_BED_SIZE)) + #define UBL_MESH_MAX_Y (min(Y_MAX_POS - (UBL_MESH_INSET), Y_BED_SIZE)) + #endif + #endif // If this is defined, the currently active mesh will be saved in the // current slot on M500. diff --git a/Marlin/src/config/examples/delta/kossel_mini/Configuration_adv.h b/Marlin/src/config/examples/delta/kossel_mini/Configuration_adv.h index b6f763372c..84e9998605 100644 --- a/Marlin/src/config/examples/delta/kossel_mini/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/kossel_mini/Configuration_adv.h @@ -675,19 +675,71 @@ // @section leveling +#if ENABLED(DELTA) && !defined(DELTA_PROBEABLE_RADIUS) + #define DELTA_PROBEABLE_RADIUS DELTA_PRINTABLE_RADIUS +#elif IS_SCARA && !defined(SCARA_PRINTABLE_RADIUS) + #define SCARA_PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2) +#endif + // Default mesh area is an area with an inset margin on the print area. // Below are the macros that are used to define the borders for the mesh area, // made available here for specialized needs, ie dual extruder setup. #if ENABLED(MESH_BED_LEVELING) - #define MESH_MIN_X MESH_INSET - #define MESH_MAX_X (X_BED_SIZE - (MESH_INSET)) - #define MESH_MIN_Y MESH_INSET - #define MESH_MAX_Y (Y_BED_SIZE - (MESH_INSET)) + #if ENABLED(DELTA) + // 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 MESH_MIN_X (X_CENTER - (DELTA_PROBEABLE_RADIUS) + MESH_INSET) + #define MESH_MIN_Y (Y_CENTER - (DELTA_PROBEABLE_RADIUS) + MESH_INSET) + #define MESH_MAX_X (X_CENTER + DELTA_PROBEABLE_RADIUS - (MESH_INSET)) + #define MESH_MAX_Y (Y_CENTER + DELTA_PROBEABLE_RADIUS - (MESH_INSET)) + #elif IS_SCARA + #define MESH_MIN_X (X_CENTER - (SCARA_PRINTABLE_RADIUS) + MESH_INSET) + #define MESH_MIN_Y (Y_CENTER - (SCARA_PRINTABLE_RADIUS) + MESH_INSET) + #define MESH_MAX_X (X_CENTER + SCARA_PRINTABLE_RADIUS - (MESH_INSET)) + #define MESH_MAX_Y (Y_CENTER + SCARA_PRINTABLE_RADIUS - (MESH_INSET)) + #else + // Boundaries for Cartesian probing based on set limits + #if ENABLED(BED_CENTER_AT_0_0) + #define MESH_MIN_X (max(MESH_INSET, 0) - (X_BED_SIZE) / 2) + #define MESH_MIN_Y (max(MESH_INSET, 0) - (Y_BED_SIZE) / 2) + #define MESH_MAX_X (min(X_BED_SIZE - (MESH_INSET), X_BED_SIZE) - (X_BED_SIZE) / 2) + #define MESH_MAX_Y (min(Y_BED_SIZE - (MESH_INSET), Y_BED_SIZE) - (Y_BED_SIZE) / 2) + #else + #define MESH_MIN_X (max(X_MIN_POS + MESH_INSET, 0)) + #define MESH_MIN_Y (max(Y_MIN_POS + MESH_INSET, 0)) + #define MESH_MAX_X (min(X_MAX_POS - (MESH_INSET), X_BED_SIZE)) + #define MESH_MAX_Y (min(Y_MAX_POS - (MESH_INSET), Y_BED_SIZE)) + #endif + #endif #elif ENABLED(AUTO_BED_LEVELING_UBL) - #define UBL_MESH_MIN_X UBL_MESH_INSET - #define UBL_MESH_MAX_X (X_BED_SIZE - (UBL_MESH_INSET)) - #define UBL_MESH_MIN_Y UBL_MESH_INSET - #define UBL_MESH_MAX_Y (Y_BED_SIZE - (UBL_MESH_INSET)) + #if ENABLED(DELTA) + // 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 UBL_MESH_MIN_X (X_CENTER - (DELTA_PROBEABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MIN_Y (Y_CENTER - (DELTA_PROBEABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MAX_X (X_CENTER + DELTA_PROBEABLE_RADIUS - (UBL_MESH_INSET)) + #define UBL_MESH_MAX_Y (Y_CENTER + DELTA_PROBEABLE_RADIUS - (UBL_MESH_INSET)) + #elif IS_SCARA + #define UBL_MESH_MIN_X (X_CENTER - (SCARA_PRINTABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MIN_Y (Y_CENTER - (SCARA_PRINTABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MAX_X (X_CENTER + SCARA_PRINTABLE_RADIUS - (UBL_MESH_INSET)) + #define UBL_MESH_MAX_Y (Y_CENTER + SCARA_PRINTABLE_RADIUS - (UBL_MESH_INSET)) + #else + // Boundaries for Cartesian probing based on set limits + #if ENABLED(BED_CENTER_AT_0_0) + #define UBL_MESH_MIN_X (max(UBL_MESH_INSET, 0) - (X_BED_SIZE) / 2) + #define UBL_MESH_MIN_Y (max(UBL_MESH_INSET, 0) - (Y_BED_SIZE) / 2) + #define UBL_MESH_MAX_X (min(X_BED_SIZE - (UBL_MESH_INSET), X_BED_SIZE) - (X_BED_SIZE) / 2) + #define UBL_MESH_MAX_Y (min(Y_BED_SIZE - (UBL_MESH_INSET), Y_BED_SIZE) - (Y_BED_SIZE) / 2) + #else + #define UBL_MESH_MIN_X (max(X_MIN_POS + UBL_MESH_INSET, 0)) + #define UBL_MESH_MIN_Y (max(Y_MIN_POS + UBL_MESH_INSET, 0)) + #define UBL_MESH_MAX_X (min(X_MAX_POS - (UBL_MESH_INSET), X_BED_SIZE)) + #define UBL_MESH_MAX_Y (min(Y_MAX_POS - (UBL_MESH_INSET), Y_BED_SIZE)) + #endif + #endif // If this is defined, the currently active mesh will be saved in the // current slot on M500. diff --git a/Marlin/src/config/examples/delta/kossel_pro/Configuration_adv.h b/Marlin/src/config/examples/delta/kossel_pro/Configuration_adv.h index f7e7c6c877..fb92763fc8 100644 --- a/Marlin/src/config/examples/delta/kossel_pro/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/kossel_pro/Configuration_adv.h @@ -680,19 +680,71 @@ // @section leveling +#if ENABLED(DELTA) && !defined(DELTA_PROBEABLE_RADIUS) + #define DELTA_PROBEABLE_RADIUS DELTA_PRINTABLE_RADIUS +#elif IS_SCARA && !defined(SCARA_PRINTABLE_RADIUS) + #define SCARA_PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2) +#endif + // Default mesh area is an area with an inset margin on the print area. // Below are the macros that are used to define the borders for the mesh area, // made available here for specialized needs, ie dual extruder setup. #if ENABLED(MESH_BED_LEVELING) - #define MESH_MIN_X MESH_INSET - #define MESH_MAX_X (X_BED_SIZE - (MESH_INSET)) - #define MESH_MIN_Y MESH_INSET - #define MESH_MAX_Y (Y_BED_SIZE - (MESH_INSET)) + #if ENABLED(DELTA) + // 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 MESH_MIN_X (X_CENTER - (DELTA_PROBEABLE_RADIUS) + MESH_INSET) + #define MESH_MIN_Y (Y_CENTER - (DELTA_PROBEABLE_RADIUS) + MESH_INSET) + #define MESH_MAX_X (X_CENTER + DELTA_PROBEABLE_RADIUS - (MESH_INSET)) + #define MESH_MAX_Y (Y_CENTER + DELTA_PROBEABLE_RADIUS - (MESH_INSET)) + #elif IS_SCARA + #define MESH_MIN_X (X_CENTER - (SCARA_PRINTABLE_RADIUS) + MESH_INSET) + #define MESH_MIN_Y (Y_CENTER - (SCARA_PRINTABLE_RADIUS) + MESH_INSET) + #define MESH_MAX_X (X_CENTER + SCARA_PRINTABLE_RADIUS - (MESH_INSET)) + #define MESH_MAX_Y (Y_CENTER + SCARA_PRINTABLE_RADIUS - (MESH_INSET)) + #else + // Boundaries for Cartesian probing based on set limits + #if ENABLED(BED_CENTER_AT_0_0) + #define MESH_MIN_X (max(MESH_INSET, 0) - (X_BED_SIZE) / 2) + #define MESH_MIN_Y (max(MESH_INSET, 0) - (Y_BED_SIZE) / 2) + #define MESH_MAX_X (min(X_BED_SIZE - (MESH_INSET), X_BED_SIZE) - (X_BED_SIZE) / 2) + #define MESH_MAX_Y (min(Y_BED_SIZE - (MESH_INSET), Y_BED_SIZE) - (Y_BED_SIZE) / 2) + #else + #define MESH_MIN_X (max(X_MIN_POS + MESH_INSET, 0)) + #define MESH_MIN_Y (max(Y_MIN_POS + MESH_INSET, 0)) + #define MESH_MAX_X (min(X_MAX_POS - (MESH_INSET), X_BED_SIZE)) + #define MESH_MAX_Y (min(Y_MAX_POS - (MESH_INSET), Y_BED_SIZE)) + #endif + #endif #elif ENABLED(AUTO_BED_LEVELING_UBL) - #define UBL_MESH_MIN_X UBL_MESH_INSET - #define UBL_MESH_MAX_X (X_BED_SIZE - (UBL_MESH_INSET)) - #define UBL_MESH_MIN_Y UBL_MESH_INSET - #define UBL_MESH_MAX_Y (Y_BED_SIZE - (UBL_MESH_INSET)) + #if ENABLED(DELTA) + // 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 UBL_MESH_MIN_X (X_CENTER - (DELTA_PROBEABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MIN_Y (Y_CENTER - (DELTA_PROBEABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MAX_X (X_CENTER + DELTA_PROBEABLE_RADIUS - (UBL_MESH_INSET)) + #define UBL_MESH_MAX_Y (Y_CENTER + DELTA_PROBEABLE_RADIUS - (UBL_MESH_INSET)) + #elif IS_SCARA + #define UBL_MESH_MIN_X (X_CENTER - (SCARA_PRINTABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MIN_Y (Y_CENTER - (SCARA_PRINTABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MAX_X (X_CENTER + SCARA_PRINTABLE_RADIUS - (UBL_MESH_INSET)) + #define UBL_MESH_MAX_Y (Y_CENTER + SCARA_PRINTABLE_RADIUS - (UBL_MESH_INSET)) + #else + // Boundaries for Cartesian probing based on set limits + #if ENABLED(BED_CENTER_AT_0_0) + #define UBL_MESH_MIN_X (max(UBL_MESH_INSET, 0) - (X_BED_SIZE) / 2) + #define UBL_MESH_MIN_Y (max(UBL_MESH_INSET, 0) - (Y_BED_SIZE) / 2) + #define UBL_MESH_MAX_X (min(X_BED_SIZE - (UBL_MESH_INSET), X_BED_SIZE) - (X_BED_SIZE) / 2) + #define UBL_MESH_MAX_Y (min(Y_BED_SIZE - (UBL_MESH_INSET), Y_BED_SIZE) - (Y_BED_SIZE) / 2) + #else + #define UBL_MESH_MIN_X (max(X_MIN_POS + UBL_MESH_INSET, 0)) + #define UBL_MESH_MIN_Y (max(Y_MIN_POS + UBL_MESH_INSET, 0)) + #define UBL_MESH_MAX_X (min(X_MAX_POS - (UBL_MESH_INSET), X_BED_SIZE)) + #define UBL_MESH_MAX_Y (min(Y_MAX_POS - (UBL_MESH_INSET), Y_BED_SIZE)) + #endif + #endif // If this is defined, the currently active mesh will be saved in the // current slot on M500. diff --git a/Marlin/src/config/examples/delta/kossel_xl/Configuration_adv.h b/Marlin/src/config/examples/delta/kossel_xl/Configuration_adv.h index 92388876d8..b72d5d3fde 100644 --- a/Marlin/src/config/examples/delta/kossel_xl/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/kossel_xl/Configuration_adv.h @@ -675,19 +675,71 @@ // @section leveling +#if ENABLED(DELTA) && !defined(DELTA_PROBEABLE_RADIUS) + #define DELTA_PROBEABLE_RADIUS DELTA_PRINTABLE_RADIUS +#elif IS_SCARA && !defined(SCARA_PRINTABLE_RADIUS) + #define SCARA_PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2) +#endif + // Default mesh area is an area with an inset margin on the print area. // Below are the macros that are used to define the borders for the mesh area, // made available here for specialized needs, ie dual extruder setup. #if ENABLED(MESH_BED_LEVELING) - #define MESH_MIN_X MESH_INSET - #define MESH_MAX_X (X_BED_SIZE - (MESH_INSET)) - #define MESH_MIN_Y MESH_INSET - #define MESH_MAX_Y (Y_BED_SIZE - (MESH_INSET)) + #if ENABLED(DELTA) + // 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 MESH_MIN_X (X_CENTER - (DELTA_PROBEABLE_RADIUS) + MESH_INSET) + #define MESH_MIN_Y (Y_CENTER - (DELTA_PROBEABLE_RADIUS) + MESH_INSET) + #define MESH_MAX_X (X_CENTER + DELTA_PROBEABLE_RADIUS - (MESH_INSET)) + #define MESH_MAX_Y (Y_CENTER + DELTA_PROBEABLE_RADIUS - (MESH_INSET)) + #elif IS_SCARA + #define MESH_MIN_X (X_CENTER - (SCARA_PRINTABLE_RADIUS) + MESH_INSET) + #define MESH_MIN_Y (Y_CENTER - (SCARA_PRINTABLE_RADIUS) + MESH_INSET) + #define MESH_MAX_X (X_CENTER + SCARA_PRINTABLE_RADIUS - (MESH_INSET)) + #define MESH_MAX_Y (Y_CENTER + SCARA_PRINTABLE_RADIUS - (MESH_INSET)) + #else + // Boundaries for Cartesian probing based on set limits + #if ENABLED(BED_CENTER_AT_0_0) + #define MESH_MIN_X (max(MESH_INSET, 0) - (X_BED_SIZE) / 2) + #define MESH_MIN_Y (max(MESH_INSET, 0) - (Y_BED_SIZE) / 2) + #define MESH_MAX_X (min(X_BED_SIZE - (MESH_INSET), X_BED_SIZE) - (X_BED_SIZE) / 2) + #define MESH_MAX_Y (min(Y_BED_SIZE - (MESH_INSET), Y_BED_SIZE) - (Y_BED_SIZE) / 2) + #else + #define MESH_MIN_X (max(X_MIN_POS + MESH_INSET, 0)) + #define MESH_MIN_Y (max(Y_MIN_POS + MESH_INSET, 0)) + #define MESH_MAX_X (min(X_MAX_POS - (MESH_INSET), X_BED_SIZE)) + #define MESH_MAX_Y (min(Y_MAX_POS - (MESH_INSET), Y_BED_SIZE)) + #endif + #endif #elif ENABLED(AUTO_BED_LEVELING_UBL) - #define UBL_MESH_MIN_X UBL_MESH_INSET - #define UBL_MESH_MAX_X (X_BED_SIZE - (UBL_MESH_INSET)) - #define UBL_MESH_MIN_Y UBL_MESH_INSET - #define UBL_MESH_MAX_Y (Y_BED_SIZE - (UBL_MESH_INSET)) + #if ENABLED(DELTA) + // 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 UBL_MESH_MIN_X (X_CENTER - (DELTA_PROBEABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MIN_Y (Y_CENTER - (DELTA_PROBEABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MAX_X (X_CENTER + DELTA_PROBEABLE_RADIUS - (UBL_MESH_INSET)) + #define UBL_MESH_MAX_Y (Y_CENTER + DELTA_PROBEABLE_RADIUS - (UBL_MESH_INSET)) + #elif IS_SCARA + #define UBL_MESH_MIN_X (X_CENTER - (SCARA_PRINTABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MIN_Y (Y_CENTER - (SCARA_PRINTABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MAX_X (X_CENTER + SCARA_PRINTABLE_RADIUS - (UBL_MESH_INSET)) + #define UBL_MESH_MAX_Y (Y_CENTER + SCARA_PRINTABLE_RADIUS - (UBL_MESH_INSET)) + #else + // Boundaries for Cartesian probing based on set limits + #if ENABLED(BED_CENTER_AT_0_0) + #define UBL_MESH_MIN_X (max(UBL_MESH_INSET, 0) - (X_BED_SIZE) / 2) + #define UBL_MESH_MIN_Y (max(UBL_MESH_INSET, 0) - (Y_BED_SIZE) / 2) + #define UBL_MESH_MAX_X (min(X_BED_SIZE - (UBL_MESH_INSET), X_BED_SIZE) - (X_BED_SIZE) / 2) + #define UBL_MESH_MAX_Y (min(Y_BED_SIZE - (UBL_MESH_INSET), Y_BED_SIZE) - (Y_BED_SIZE) / 2) + #else + #define UBL_MESH_MIN_X (max(X_MIN_POS + UBL_MESH_INSET, 0)) + #define UBL_MESH_MIN_Y (max(Y_MIN_POS + UBL_MESH_INSET, 0)) + #define UBL_MESH_MAX_X (min(X_MAX_POS - (UBL_MESH_INSET), X_BED_SIZE)) + #define UBL_MESH_MAX_Y (min(Y_MAX_POS - (UBL_MESH_INSET), Y_BED_SIZE)) + #endif + #endif // If this is defined, the currently active mesh will be saved in the // current slot on M500. diff --git a/Marlin/src/config/examples/gCreate/gMax1.5+/Configuration_adv.h b/Marlin/src/config/examples/gCreate/gMax1.5+/Configuration_adv.h index 905f45d6da..19c88458e6 100644 --- a/Marlin/src/config/examples/gCreate/gMax1.5+/Configuration_adv.h +++ b/Marlin/src/config/examples/gCreate/gMax1.5+/Configuration_adv.h @@ -673,19 +673,71 @@ // @section leveling +#if ENABLED(DELTA) && !defined(DELTA_PROBEABLE_RADIUS) + #define DELTA_PROBEABLE_RADIUS DELTA_PRINTABLE_RADIUS +#elif IS_SCARA && !defined(SCARA_PRINTABLE_RADIUS) + #define SCARA_PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2) +#endif + // Default mesh area is an area with an inset margin on the print area. // Below are the macros that are used to define the borders for the mesh area, // made available here for specialized needs, ie dual extruder setup. #if ENABLED(MESH_BED_LEVELING) - #define MESH_MIN_X MESH_INSET - #define MESH_MAX_X (X_BED_SIZE - (MESH_INSET)) - #define MESH_MIN_Y MESH_INSET - #define MESH_MAX_Y (Y_BED_SIZE - (MESH_INSET)) + #if ENABLED(DELTA) + // 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 MESH_MIN_X (X_CENTER - (DELTA_PROBEABLE_RADIUS) + MESH_INSET) + #define MESH_MIN_Y (Y_CENTER - (DELTA_PROBEABLE_RADIUS) + MESH_INSET) + #define MESH_MAX_X (X_CENTER + DELTA_PROBEABLE_RADIUS - (MESH_INSET)) + #define MESH_MAX_Y (Y_CENTER + DELTA_PROBEABLE_RADIUS - (MESH_INSET)) + #elif IS_SCARA + #define MESH_MIN_X (X_CENTER - (SCARA_PRINTABLE_RADIUS) + MESH_INSET) + #define MESH_MIN_Y (Y_CENTER - (SCARA_PRINTABLE_RADIUS) + MESH_INSET) + #define MESH_MAX_X (X_CENTER + SCARA_PRINTABLE_RADIUS - (MESH_INSET)) + #define MESH_MAX_Y (Y_CENTER + SCARA_PRINTABLE_RADIUS - (MESH_INSET)) + #else + // Boundaries for Cartesian probing based on set limits + #if ENABLED(BED_CENTER_AT_0_0) + #define MESH_MIN_X (max(MESH_INSET, 0) - (X_BED_SIZE) / 2) + #define MESH_MIN_Y (max(MESH_INSET, 0) - (Y_BED_SIZE) / 2) + #define MESH_MAX_X (min(X_BED_SIZE - (MESH_INSET), X_BED_SIZE) - (X_BED_SIZE) / 2) + #define MESH_MAX_Y (min(Y_BED_SIZE - (MESH_INSET), Y_BED_SIZE) - (Y_BED_SIZE) / 2) + #else + #define MESH_MIN_X (max(X_MIN_POS + MESH_INSET, 0)) + #define MESH_MIN_Y (max(Y_MIN_POS + MESH_INSET, 0)) + #define MESH_MAX_X (min(X_MAX_POS - (MESH_INSET), X_BED_SIZE)) + #define MESH_MAX_Y (min(Y_MAX_POS - (MESH_INSET), Y_BED_SIZE)) + #endif + #endif #elif ENABLED(AUTO_BED_LEVELING_UBL) - #define UBL_MESH_MIN_X UBL_MESH_INSET - #define UBL_MESH_MAX_X (X_BED_SIZE - (UBL_MESH_INSET)) - #define UBL_MESH_MIN_Y UBL_MESH_INSET - #define UBL_MESH_MAX_Y (Y_BED_SIZE - (UBL_MESH_INSET)) + #if ENABLED(DELTA) + // 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 UBL_MESH_MIN_X (X_CENTER - (DELTA_PROBEABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MIN_Y (Y_CENTER - (DELTA_PROBEABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MAX_X (X_CENTER + DELTA_PROBEABLE_RADIUS - (UBL_MESH_INSET)) + #define UBL_MESH_MAX_Y (Y_CENTER + DELTA_PROBEABLE_RADIUS - (UBL_MESH_INSET)) + #elif IS_SCARA + #define UBL_MESH_MIN_X (X_CENTER - (SCARA_PRINTABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MIN_Y (Y_CENTER - (SCARA_PRINTABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MAX_X (X_CENTER + SCARA_PRINTABLE_RADIUS - (UBL_MESH_INSET)) + #define UBL_MESH_MAX_Y (Y_CENTER + SCARA_PRINTABLE_RADIUS - (UBL_MESH_INSET)) + #else + // Boundaries for Cartesian probing based on set limits + #if ENABLED(BED_CENTER_AT_0_0) + #define UBL_MESH_MIN_X (max(UBL_MESH_INSET, 0) - (X_BED_SIZE) / 2) + #define UBL_MESH_MIN_Y (max(UBL_MESH_INSET, 0) - (Y_BED_SIZE) / 2) + #define UBL_MESH_MAX_X (min(X_BED_SIZE - (UBL_MESH_INSET), X_BED_SIZE) - (X_BED_SIZE) / 2) + #define UBL_MESH_MAX_Y (min(Y_BED_SIZE - (UBL_MESH_INSET), Y_BED_SIZE) - (Y_BED_SIZE) / 2) + #else + #define UBL_MESH_MIN_X (max(X_MIN_POS + UBL_MESH_INSET, 0)) + #define UBL_MESH_MIN_Y (max(Y_MIN_POS + UBL_MESH_INSET, 0)) + #define UBL_MESH_MAX_X (min(X_MAX_POS - (UBL_MESH_INSET), X_BED_SIZE)) + #define UBL_MESH_MAX_Y (min(Y_MAX_POS - (UBL_MESH_INSET), Y_BED_SIZE)) + #endif + #endif // If this is defined, the currently active mesh will be saved in the // current slot on M500. diff --git a/Marlin/src/config/examples/makibox/Configuration_adv.h b/Marlin/src/config/examples/makibox/Configuration_adv.h index f73b79e81c..1d40e2d13b 100644 --- a/Marlin/src/config/examples/makibox/Configuration_adv.h +++ b/Marlin/src/config/examples/makibox/Configuration_adv.h @@ -673,19 +673,71 @@ // @section leveling +#if ENABLED(DELTA) && !defined(DELTA_PROBEABLE_RADIUS) + #define DELTA_PROBEABLE_RADIUS DELTA_PRINTABLE_RADIUS +#elif IS_SCARA && !defined(SCARA_PRINTABLE_RADIUS) + #define SCARA_PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2) +#endif + // Default mesh area is an area with an inset margin on the print area. // Below are the macros that are used to define the borders for the mesh area, // made available here for specialized needs, ie dual extruder setup. #if ENABLED(MESH_BED_LEVELING) - #define MESH_MIN_X MESH_INSET - #define MESH_MAX_X (X_BED_SIZE - (MESH_INSET)) - #define MESH_MIN_Y MESH_INSET - #define MESH_MAX_Y (Y_BED_SIZE - (MESH_INSET)) + #if ENABLED(DELTA) + // 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 MESH_MIN_X (X_CENTER - (DELTA_PROBEABLE_RADIUS) + MESH_INSET) + #define MESH_MIN_Y (Y_CENTER - (DELTA_PROBEABLE_RADIUS) + MESH_INSET) + #define MESH_MAX_X (X_CENTER + DELTA_PROBEABLE_RADIUS - (MESH_INSET)) + #define MESH_MAX_Y (Y_CENTER + DELTA_PROBEABLE_RADIUS - (MESH_INSET)) + #elif IS_SCARA + #define MESH_MIN_X (X_CENTER - (SCARA_PRINTABLE_RADIUS) + MESH_INSET) + #define MESH_MIN_Y (Y_CENTER - (SCARA_PRINTABLE_RADIUS) + MESH_INSET) + #define MESH_MAX_X (X_CENTER + SCARA_PRINTABLE_RADIUS - (MESH_INSET)) + #define MESH_MAX_Y (Y_CENTER + SCARA_PRINTABLE_RADIUS - (MESH_INSET)) + #else + // Boundaries for Cartesian probing based on set limits + #if ENABLED(BED_CENTER_AT_0_0) + #define MESH_MIN_X (max(MESH_INSET, 0) - (X_BED_SIZE) / 2) + #define MESH_MIN_Y (max(MESH_INSET, 0) - (Y_BED_SIZE) / 2) + #define MESH_MAX_X (min(X_BED_SIZE - (MESH_INSET), X_BED_SIZE) - (X_BED_SIZE) / 2) + #define MESH_MAX_Y (min(Y_BED_SIZE - (MESH_INSET), Y_BED_SIZE) - (Y_BED_SIZE) / 2) + #else + #define MESH_MIN_X (max(X_MIN_POS + MESH_INSET, 0)) + #define MESH_MIN_Y (max(Y_MIN_POS + MESH_INSET, 0)) + #define MESH_MAX_X (min(X_MAX_POS - (MESH_INSET), X_BED_SIZE)) + #define MESH_MAX_Y (min(Y_MAX_POS - (MESH_INSET), Y_BED_SIZE)) + #endif + #endif #elif ENABLED(AUTO_BED_LEVELING_UBL) - #define UBL_MESH_MIN_X UBL_MESH_INSET - #define UBL_MESH_MAX_X (X_BED_SIZE - (UBL_MESH_INSET)) - #define UBL_MESH_MIN_Y UBL_MESH_INSET - #define UBL_MESH_MAX_Y (Y_BED_SIZE - (UBL_MESH_INSET)) + #if ENABLED(DELTA) + // 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 UBL_MESH_MIN_X (X_CENTER - (DELTA_PROBEABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MIN_Y (Y_CENTER - (DELTA_PROBEABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MAX_X (X_CENTER + DELTA_PROBEABLE_RADIUS - (UBL_MESH_INSET)) + #define UBL_MESH_MAX_Y (Y_CENTER + DELTA_PROBEABLE_RADIUS - (UBL_MESH_INSET)) + #elif IS_SCARA + #define UBL_MESH_MIN_X (X_CENTER - (SCARA_PRINTABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MIN_Y (Y_CENTER - (SCARA_PRINTABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MAX_X (X_CENTER + SCARA_PRINTABLE_RADIUS - (UBL_MESH_INSET)) + #define UBL_MESH_MAX_Y (Y_CENTER + SCARA_PRINTABLE_RADIUS - (UBL_MESH_INSET)) + #else + // Boundaries for Cartesian probing based on set limits + #if ENABLED(BED_CENTER_AT_0_0) + #define UBL_MESH_MIN_X (max(UBL_MESH_INSET, 0) - (X_BED_SIZE) / 2) + #define UBL_MESH_MIN_Y (max(UBL_MESH_INSET, 0) - (Y_BED_SIZE) / 2) + #define UBL_MESH_MAX_X (min(X_BED_SIZE - (UBL_MESH_INSET), X_BED_SIZE) - (X_BED_SIZE) / 2) + #define UBL_MESH_MAX_Y (min(Y_BED_SIZE - (UBL_MESH_INSET), Y_BED_SIZE) - (Y_BED_SIZE) / 2) + #else + #define UBL_MESH_MIN_X (max(X_MIN_POS + UBL_MESH_INSET, 0)) + #define UBL_MESH_MIN_Y (max(Y_MIN_POS + UBL_MESH_INSET, 0)) + #define UBL_MESH_MAX_X (min(X_MAX_POS - (UBL_MESH_INSET), X_BED_SIZE)) + #define UBL_MESH_MAX_Y (min(Y_MAX_POS - (UBL_MESH_INSET), Y_BED_SIZE)) + #endif + #endif // If this is defined, the currently active mesh will be saved in the // current slot on M500. diff --git a/Marlin/src/config/examples/tvrrug/Round2/Configuration_adv.h b/Marlin/src/config/examples/tvrrug/Round2/Configuration_adv.h index a236890919..b6630e7cbe 100644 --- a/Marlin/src/config/examples/tvrrug/Round2/Configuration_adv.h +++ b/Marlin/src/config/examples/tvrrug/Round2/Configuration_adv.h @@ -673,19 +673,71 @@ // @section leveling +#if ENABLED(DELTA) && !defined(DELTA_PROBEABLE_RADIUS) + #define DELTA_PROBEABLE_RADIUS DELTA_PRINTABLE_RADIUS +#elif IS_SCARA && !defined(SCARA_PRINTABLE_RADIUS) + #define SCARA_PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2) +#endif + // Default mesh area is an area with an inset margin on the print area. // Below are the macros that are used to define the borders for the mesh area, // made available here for specialized needs, ie dual extruder setup. #if ENABLED(MESH_BED_LEVELING) - #define MESH_MIN_X MESH_INSET - #define MESH_MAX_X (X_BED_SIZE - (MESH_INSET)) - #define MESH_MIN_Y MESH_INSET - #define MESH_MAX_Y (Y_BED_SIZE - (MESH_INSET)) + #if ENABLED(DELTA) + // 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 MESH_MIN_X (X_CENTER - (DELTA_PROBEABLE_RADIUS) + MESH_INSET) + #define MESH_MIN_Y (Y_CENTER - (DELTA_PROBEABLE_RADIUS) + MESH_INSET) + #define MESH_MAX_X (X_CENTER + DELTA_PROBEABLE_RADIUS - (MESH_INSET)) + #define MESH_MAX_Y (Y_CENTER + DELTA_PROBEABLE_RADIUS - (MESH_INSET)) + #elif IS_SCARA + #define MESH_MIN_X (X_CENTER - (SCARA_PRINTABLE_RADIUS) + MESH_INSET) + #define MESH_MIN_Y (Y_CENTER - (SCARA_PRINTABLE_RADIUS) + MESH_INSET) + #define MESH_MAX_X (X_CENTER + SCARA_PRINTABLE_RADIUS - (MESH_INSET)) + #define MESH_MAX_Y (Y_CENTER + SCARA_PRINTABLE_RADIUS - (MESH_INSET)) + #else + // Boundaries for Cartesian probing based on set limits + #if ENABLED(BED_CENTER_AT_0_0) + #define MESH_MIN_X (max(MESH_INSET, 0) - (X_BED_SIZE) / 2) + #define MESH_MIN_Y (max(MESH_INSET, 0) - (Y_BED_SIZE) / 2) + #define MESH_MAX_X (min(X_BED_SIZE - (MESH_INSET), X_BED_SIZE) - (X_BED_SIZE) / 2) + #define MESH_MAX_Y (min(Y_BED_SIZE - (MESH_INSET), Y_BED_SIZE) - (Y_BED_SIZE) / 2) + #else + #define MESH_MIN_X (max(X_MIN_POS + MESH_INSET, 0)) + #define MESH_MIN_Y (max(Y_MIN_POS + MESH_INSET, 0)) + #define MESH_MAX_X (min(X_MAX_POS - (MESH_INSET), X_BED_SIZE)) + #define MESH_MAX_Y (min(Y_MAX_POS - (MESH_INSET), Y_BED_SIZE)) + #endif + #endif #elif ENABLED(AUTO_BED_LEVELING_UBL) - #define UBL_MESH_MIN_X UBL_MESH_INSET - #define UBL_MESH_MAX_X (X_BED_SIZE - (UBL_MESH_INSET)) - #define UBL_MESH_MIN_Y UBL_MESH_INSET - #define UBL_MESH_MAX_Y (Y_BED_SIZE - (UBL_MESH_INSET)) + #if ENABLED(DELTA) + // 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 UBL_MESH_MIN_X (X_CENTER - (DELTA_PROBEABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MIN_Y (Y_CENTER - (DELTA_PROBEABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MAX_X (X_CENTER + DELTA_PROBEABLE_RADIUS - (UBL_MESH_INSET)) + #define UBL_MESH_MAX_Y (Y_CENTER + DELTA_PROBEABLE_RADIUS - (UBL_MESH_INSET)) + #elif IS_SCARA + #define UBL_MESH_MIN_X (X_CENTER - (SCARA_PRINTABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MIN_Y (Y_CENTER - (SCARA_PRINTABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MAX_X (X_CENTER + SCARA_PRINTABLE_RADIUS - (UBL_MESH_INSET)) + #define UBL_MESH_MAX_Y (Y_CENTER + SCARA_PRINTABLE_RADIUS - (UBL_MESH_INSET)) + #else + // Boundaries for Cartesian probing based on set limits + #if ENABLED(BED_CENTER_AT_0_0) + #define UBL_MESH_MIN_X (max(UBL_MESH_INSET, 0) - (X_BED_SIZE) / 2) + #define UBL_MESH_MIN_Y (max(UBL_MESH_INSET, 0) - (Y_BED_SIZE) / 2) + #define UBL_MESH_MAX_X (min(X_BED_SIZE - (UBL_MESH_INSET), X_BED_SIZE) - (X_BED_SIZE) / 2) + #define UBL_MESH_MAX_Y (min(Y_BED_SIZE - (UBL_MESH_INSET), Y_BED_SIZE) - (Y_BED_SIZE) / 2) + #else + #define UBL_MESH_MIN_X (max(X_MIN_POS + UBL_MESH_INSET, 0)) + #define UBL_MESH_MIN_Y (max(Y_MIN_POS + UBL_MESH_INSET, 0)) + #define UBL_MESH_MAX_X (min(X_MAX_POS - (UBL_MESH_INSET), X_BED_SIZE)) + #define UBL_MESH_MAX_Y (min(Y_MAX_POS - (UBL_MESH_INSET), Y_BED_SIZE)) + #endif + #endif // If this is defined, the currently active mesh will be saved in the // current slot on M500. diff --git a/Marlin/src/config/examples/wt150/Configuration_adv.h b/Marlin/src/config/examples/wt150/Configuration_adv.h index 581e695ca3..fdec2631cf 100644 --- a/Marlin/src/config/examples/wt150/Configuration_adv.h +++ b/Marlin/src/config/examples/wt150/Configuration_adv.h @@ -673,19 +673,71 @@ // @section leveling +#if ENABLED(DELTA) && !defined(DELTA_PROBEABLE_RADIUS) + #define DELTA_PROBEABLE_RADIUS DELTA_PRINTABLE_RADIUS +#elif IS_SCARA && !defined(SCARA_PRINTABLE_RADIUS) + #define SCARA_PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2) +#endif + // Default mesh area is an area with an inset margin on the print area. // Below are the macros that are used to define the borders for the mesh area, // made available here for specialized needs, ie dual extruder setup. #if ENABLED(MESH_BED_LEVELING) - #define MESH_MIN_X MESH_INSET - #define MESH_MAX_X (X_BED_SIZE - (MESH_INSET)) - #define MESH_MIN_Y MESH_INSET - #define MESH_MAX_Y (Y_BED_SIZE - (MESH_INSET)) + #if ENABLED(DELTA) + // 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 MESH_MIN_X (X_CENTER - (DELTA_PROBEABLE_RADIUS) + MESH_INSET) + #define MESH_MIN_Y (Y_CENTER - (DELTA_PROBEABLE_RADIUS) + MESH_INSET) + #define MESH_MAX_X (X_CENTER + DELTA_PROBEABLE_RADIUS - (MESH_INSET)) + #define MESH_MAX_Y (Y_CENTER + DELTA_PROBEABLE_RADIUS - (MESH_INSET)) + #elif IS_SCARA + #define MESH_MIN_X (X_CENTER - (SCARA_PRINTABLE_RADIUS) + MESH_INSET) + #define MESH_MIN_Y (Y_CENTER - (SCARA_PRINTABLE_RADIUS) + MESH_INSET) + #define MESH_MAX_X (X_CENTER + SCARA_PRINTABLE_RADIUS - (MESH_INSET)) + #define MESH_MAX_Y (Y_CENTER + SCARA_PRINTABLE_RADIUS - (MESH_INSET)) + #else + // Boundaries for Cartesian probing based on set limits + #if ENABLED(BED_CENTER_AT_0_0) + #define MESH_MIN_X (max(MESH_INSET, 0) - (X_BED_SIZE) / 2) + #define MESH_MIN_Y (max(MESH_INSET, 0) - (Y_BED_SIZE) / 2) + #define MESH_MAX_X (min(X_BED_SIZE - (MESH_INSET), X_BED_SIZE) - (X_BED_SIZE) / 2) + #define MESH_MAX_Y (min(Y_BED_SIZE - (MESH_INSET), Y_BED_SIZE) - (Y_BED_SIZE) / 2) + #else + #define MESH_MIN_X (max(X_MIN_POS + MESH_INSET, 0)) + #define MESH_MIN_Y (max(Y_MIN_POS + MESH_INSET, 0)) + #define MESH_MAX_X (min(X_MAX_POS - (MESH_INSET), X_BED_SIZE)) + #define MESH_MAX_Y (min(Y_MAX_POS - (MESH_INSET), Y_BED_SIZE)) + #endif + #endif #elif ENABLED(AUTO_BED_LEVELING_UBL) - #define UBL_MESH_MIN_X UBL_MESH_INSET - #define UBL_MESH_MAX_X (X_BED_SIZE - (UBL_MESH_INSET)) - #define UBL_MESH_MIN_Y UBL_MESH_INSET - #define UBL_MESH_MAX_Y (Y_BED_SIZE - (UBL_MESH_INSET)) + #if ENABLED(DELTA) + // 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 UBL_MESH_MIN_X (X_CENTER - (DELTA_PROBEABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MIN_Y (Y_CENTER - (DELTA_PROBEABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MAX_X (X_CENTER + DELTA_PROBEABLE_RADIUS - (UBL_MESH_INSET)) + #define UBL_MESH_MAX_Y (Y_CENTER + DELTA_PROBEABLE_RADIUS - (UBL_MESH_INSET)) + #elif IS_SCARA + #define UBL_MESH_MIN_X (X_CENTER - (SCARA_PRINTABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MIN_Y (Y_CENTER - (SCARA_PRINTABLE_RADIUS) + UBL_MESH_INSET) + #define UBL_MESH_MAX_X (X_CENTER + SCARA_PRINTABLE_RADIUS - (UBL_MESH_INSET)) + #define UBL_MESH_MAX_Y (Y_CENTER + SCARA_PRINTABLE_RADIUS - (UBL_MESH_INSET)) + #else + // Boundaries for Cartesian probing based on set limits + #if ENABLED(BED_CENTER_AT_0_0) + #define UBL_MESH_MIN_X (max(UBL_MESH_INSET, 0) - (X_BED_SIZE) / 2) + #define UBL_MESH_MIN_Y (max(UBL_MESH_INSET, 0) - (Y_BED_SIZE) / 2) + #define UBL_MESH_MAX_X (min(X_BED_SIZE - (UBL_MESH_INSET), X_BED_SIZE) - (X_BED_SIZE) / 2) + #define UBL_MESH_MAX_Y (min(Y_BED_SIZE - (UBL_MESH_INSET), Y_BED_SIZE) - (Y_BED_SIZE) / 2) + #else + #define UBL_MESH_MIN_X (max(X_MIN_POS + UBL_MESH_INSET, 0)) + #define UBL_MESH_MIN_Y (max(Y_MIN_POS + UBL_MESH_INSET, 0)) + #define UBL_MESH_MAX_X (min(X_MAX_POS - (UBL_MESH_INSET), X_BED_SIZE)) + #define UBL_MESH_MAX_Y (min(Y_MAX_POS - (UBL_MESH_INSET), Y_BED_SIZE)) + #endif + #endif // If this is defined, the currently active mesh will be saved in the // current slot on M500. From 572cf0ec951f9a1703d50d2e10b62f323b76941f Mon Sep 17 00:00:00 2001 From: Roxy-3D Date: Wed, 18 Oct 2017 14:00:29 -0500 Subject: [PATCH 2/5] UBL able to generate mesh and save and load it on 32-bit platforms (#8015) * Get UBL Mesh Generation, Mesh Save & Mesh Load working with 32-Bit platforms * clean up read_data() and write_data() for non-LPC1768 HAL's * Get read_data() and write_data() return codes consistent All HAL's read_data() and write_data() return false if they succeed. * Get read_data() and write_data() return codes to be consistent Make read_data() and write_data() return true if an error happens. * Say UBL is now checked out on machine types in default Configuration.h file. --- Marlin/Configuration.h | 7 +- .../src/HAL/HAL_AVR/persistent_store_impl.cpp | 7 +- .../src/HAL/HAL_DUE/persistent_store_impl.cpp | 7 +- .../HAL/HAL_LPC1768/persistent_store_impl.cpp | 85 +++++++++++++++++-- .../HAL/HAL_STM32F1/persistent_store_impl.cpp | 5 +- .../HAL_TEENSY35_36/persistent_store_impl.cpp | 7 +- Marlin/src/HAL/persistent_store_api.h | 2 +- Marlin/src/config/default/Configuration.h | 7 +- .../AlephObjects/TAZ4/Configuration.h | 7 +- .../AliExpress/CL-260/Configuration.h | 7 +- .../config/examples/Anet/A6/Configuration.h | 7 +- .../config/examples/Anet/A8/Configuration.h | 7 +- .../examples/BQ/Hephestos/Configuration.h | 7 +- .../examples/BQ/Hephestos_2/Configuration.h | 7 +- .../config/examples/BQ/WITBOX/Configuration.h | 7 +- .../config/examples/Cartesio/Configuration.h | 7 +- .../examples/Creality/CR-10/Configuration.h | 7 +- .../src/config/examples/Felix/Configuration.h | 7 +- .../examples/Felix/DUAL/Configuration.h | 7 +- .../Folger Tech/i3-2020/Configuration.h | 9 +- .../examples/Geeetech/GT2560/Configuration.h | 7 +- .../Geeetech/I3_Pro_X-GT2560/Configuration.h | 7 +- .../examples/Infitary/i3-M508/Configuration.h | 7 +- .../examples/Malyan/M150/Configuration.h | 7 +- .../Micromake/C1/basic/Configuration.h | 7 +- .../Micromake/C1/enhanced/Configuration.h | 7 +- .../config/examples/Mks/Sbase/Configuration.h | 7 +- .../RepRapWorld/Megatronics/Configuration.h | 7 +- .../config/examples/RigidBot/Configuration.h | 7 +- .../src/config/examples/SCARA/Configuration.h | 7 +- .../examples/Sanguinololu/Configuration.h | 7 +- .../config/examples/TinyBoy2/Configuration.h | 7 +- .../examples/Velleman/K8200/Configuration.h | 7 +- .../examples/Velleman/K8400/Configuration.h | 7 +- .../Velleman/K8400/Dual-head/Configuration.h | 7 +- .../examples/adafruit/ST7565/Configuration.h | 7 +- .../FLSUN/auto_calibrate/Configuration.h | 7 +- .../delta/FLSUN/kossel_mini/Configuration.h | 7 +- .../examples/delta/generic/Configuration.h | 7 +- .../delta/kossel_mini/Configuration.h | 7 +- .../examples/delta/kossel_pro/Configuration.h | 7 +- .../examples/delta/kossel_xl/Configuration.h | 7 +- .../examples/gCreate/gMax1.5+/Configuration.h | 7 +- .../config/examples/makibox/Configuration.h | 7 +- .../examples/stm32f103ret6/Configuration.h | 7 +- .../examples/tvrrug/Round2/Configuration.h | 7 +- .../src/config/examples/wt150/Configuration.h | 7 +- Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp | 2 +- Marlin/src/module/configuration_store.cpp | 26 ++++-- 49 files changed, 157 insertions(+), 273 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 51d3cdcfb4..7781008aca 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -854,12 +854,7 @@ * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) * A comprehensive bed leveling system combining the features and benefits * of other systems. UBL also includes integrated Mesh Generation, Mesh - * Validation and Mesh Editing systems. Currently, UBL is only checked out - * for Cartesian Printers. That said, it was primarily designed to correct - * poor quality Delta Printers. If you feel adventurous and have a Delta, - * please post an issue if something doesn't work correctly. Initially, - * you will need to set a reduced bed size so you have a rectangular area - * to test on. + * Validation and Mesh Editing systems. * * - MESH_BED_LEVELING * Probe a grid manually diff --git a/Marlin/src/HAL/HAL_AVR/persistent_store_impl.cpp b/Marlin/src/HAL/HAL_AVR/persistent_store_impl.cpp index b15945e7de..bee8caf833 100644 --- a/Marlin/src/HAL/HAL_AVR/persistent_store_impl.cpp +++ b/Marlin/src/HAL/HAL_AVR/persistent_store_impl.cpp @@ -28,17 +28,17 @@ bool write_data(int &pos, const uint8_t *value, uint16_t size, uint16_t *crc) { if (eeprom_read_byte(p) != v) { SERIAL_ECHO_START(); SERIAL_ECHOLNPGM(MSG_ERR_EEPROM_WRITE); - return false; + return true; } } crc16(crc, &v, 1); pos++; value++; }; - return true; + return false; } -void read_data(int &pos, uint8_t* value, uint16_t size, uint16_t *crc) { +bool read_data(int &pos, uint8_t* value, uint16_t size, uint16_t *crc) { do { uint8_t c = eeprom_read_byte((unsigned char*)pos); *value = c; @@ -46,6 +46,7 @@ void read_data(int &pos, uint8_t* value, uint16_t size, uint16_t *crc) { pos++; value++; } while (--size); + return false; // always assume success for AVR's } } diff --git a/Marlin/src/HAL/HAL_DUE/persistent_store_impl.cpp b/Marlin/src/HAL/HAL_DUE/persistent_store_impl.cpp index 26a53ee111..7bc191060e 100644 --- a/Marlin/src/HAL/HAL_DUE/persistent_store_impl.cpp +++ b/Marlin/src/HAL/HAL_DUE/persistent_store_impl.cpp @@ -28,17 +28,17 @@ bool write_data(int &pos, const uint8_t *value, uint16_t size, uint16_t *crc) { if (eeprom_read_byte(p) != v) { SERIAL_ECHO_START(); SERIAL_ECHOLNPGM(MSG_ERR_EEPROM_WRITE); - return false; + return true; } } crc16(crc, &v, 1); pos++; value++; }; - return true; + return false; } -void read_data(int &pos, uint8_t* value, uint16_t size, uint16_t *crc) { +bool read_data(int &pos, uint8_t* value, uint16_t size, uint16_t *crc) { do { uint8_t c = eeprom_read_byte((unsigned char*)pos); *value = c; @@ -46,6 +46,7 @@ void read_data(int &pos, uint8_t* value, uint16_t size, uint16_t *crc) { pos++; value++; } while (--size); + return false; } } diff --git a/Marlin/src/HAL/HAL_LPC1768/persistent_store_impl.cpp b/Marlin/src/HAL/HAL_LPC1768/persistent_store_impl.cpp index eb78b96130..222cb5b08a 100644 --- a/Marlin/src/HAL/HAL_LPC1768/persistent_store_impl.cpp +++ b/Marlin/src/HAL/HAL_LPC1768/persistent_store_impl.cpp @@ -34,7 +34,7 @@ bool access_start() { if (res == FR_OK) { f_lseek(&eeprom_file, file_size); - while (file_size < E2END && res == FR_OK) { + while (file_size <= E2END && res == FR_OK) { res = f_write(&eeprom_file, &eeprom_zero, 1, &bytes_written); file_size++; } @@ -53,21 +53,92 @@ bool access_finish() { return true; } +// File function return codes for type FRESULT This goes away soon. But it is helpful right now to see +// the different errors the read_data() and write_data() functions are seeing. +// +//typedef enum { +// FR_OK = 0, /* (0) Succeeded */ +// FR_DISK_ERR, /* (1) A hard error occurred in the low level disk I/O layer */ +// FR_INT_ERR, /* (2) Assertion failed */ +// FR_NOT_READY, /* (3) The physical drive cannot work */ +// FR_NO_FILE, /* (4) Could not find the file */ +// FR_NO_PATH, /* (5) Could not find the path */ +// FR_INVALID_NAME, /* (6) The path name format is invalid */ +// FR_DENIED, /* (7) Access denied due to prohibited access or directory full */ +// FR_EXIST, /* (8) Access denied due to prohibited access */ +// FR_INVALID_OBJECT, /* (9) The file/directory object is invalid */ +// FR_WRITE_PROTECTED, /* (10) The physical drive is write protected */ +// FR_INVALID_DRIVE, /* (11) The logical drive number is invalid */ +// FR_NOT_ENABLED, /* (12) The volume has no work area */ +// FR_NO_FILESYSTEM, /* (13) There is no valid FAT volume */ +// FR_MKFS_ABORTED, /* (14) The f_mkfs() aborted due to any problem */ +// FR_TIMEOUT, /* (15) Could not get a grant to access the volume within defined period */ +// FR_LOCKED, /* (16) The operation is rejected according to the file sharing policy */ +// FR_NOT_ENOUGH_CORE, /* (17) LFN working buffer could not be allocated */ +// FR_TOO_MANY_OPEN_FILES, /* (18) Number of open files > FF_FS_LOCK */ +// FR_INVALID_PARAMETER /* (19) Given parameter is invalid */ +//} FRESULT; + bool write_data(int &pos, const uint8_t *value, uint16_t size, uint16_t *crc) { + FRESULT s; UINT bytes_written = 0; - f_lseek(&eeprom_file, pos); - f_write(&eeprom_file, (void *)value, size, &bytes_written); + s = f_lseek(&eeprom_file, pos); + if ( s ) { + SERIAL_PROTOCOLPAIR(" write_data(", pos); // This extra chit-chat goes away soon. But it is helpful + SERIAL_PROTOCOLPAIR(",", (int) value); // right now to see errors that are happening in the + SERIAL_PROTOCOLPAIR(",", (int) size); // read_data() and write_data() functions + SERIAL_PROTOCOL("...)\n"); + SERIAL_PROTOCOLPAIR(" f_lseek()=", (int) s); + SERIAL_PROTOCOL("\n"); + return s; + } + s = f_write(&eeprom_file, (void *)value, size, &bytes_written); + if ( s ) { + SERIAL_PROTOCOLPAIR(" write_data(", pos); // This extra chit-chat goes away soon. But it is helpful + SERIAL_PROTOCOLPAIR(",", (int) value); // right now to see errors that are happening in the + SERIAL_PROTOCOLPAIR(",", (int) size); // read_data() and write_data() functions + SERIAL_PROTOCOL("...)\n"); + SERIAL_PROTOCOLPAIR(" f_write()=", (int) s); + SERIAL_PROTOCOL("\n"); + SERIAL_PROTOCOLPAIR(" size=", (int) size); + SERIAL_PROTOCOLPAIR("\n bytes_written=", (int) bytes_written); + SERIAL_PROTOCOL("\n"); + return s; + } crc16(crc, value, size); pos = pos + size; - return (bytes_written == size); + return (bytes_written != size); // return true for any error } -void read_data(int &pos, uint8_t* value, uint16_t size, uint16_t *crc) { +bool read_data(int &pos, uint8_t* value, uint16_t size, uint16_t *crc) { UINT bytes_read = 0; - f_lseek(&eeprom_file, pos); - f_read(&eeprom_file, (void *)value, size, &bytes_read); + FRESULT s; + s = f_lseek(&eeprom_file, pos); + if ( s ) { + SERIAL_PROTOCOLPAIR(" read_data(", pos); // This extra chit-chat goes away soon. But it is helpful + SERIAL_PROTOCOLPAIR(",", (int) value); // right now to see errors that are happening in the + SERIAL_PROTOCOLPAIR(",", (int) size); // read_data() and write_data() functions + SERIAL_PROTOCOL("...)\n"); + SERIAL_PROTOCOLPAIR(" f_lseek()=", (int) s); + SERIAL_PROTOCOL("\n"); + return true; + } + s = f_read(&eeprom_file, (void *)value, size, &bytes_read); + if ( s ) { + SERIAL_PROTOCOLPAIR(" read_data(", pos); // This extra chit-chat goes away soon. But it is helpful + SERIAL_PROTOCOLPAIR(",", (int) value); // right now to see errors that are happening in the + SERIAL_PROTOCOLPAIR(",", (int) size); // read_data() and write_data() functions + SERIAL_PROTOCOL("...)\n"); + SERIAL_PROTOCOLPAIR(" f_write()=", (int) s); + SERIAL_PROTOCOL("\n"); + SERIAL_PROTOCOLPAIR(" size=", (int) size); + SERIAL_PROTOCOLPAIR("\n bytes_read=", (int) bytes_read); + SERIAL_PROTOCOL("\n"); + return true; + } crc16(crc, value, size); pos = pos + size; + return bytes_read != size; // return true for any error } } // PersistentStore diff --git a/Marlin/src/HAL/HAL_STM32F1/persistent_store_impl.cpp b/Marlin/src/HAL/HAL_STM32F1/persistent_store_impl.cpp index af4f965d9a..87004513fe 100644 --- a/Marlin/src/HAL/HAL_STM32F1/persistent_store_impl.cpp +++ b/Marlin/src/HAL/HAL_STM32F1/persistent_store_impl.cpp @@ -78,15 +78,16 @@ bool write_data(int &pos, const uint8_t *value, uint16_t size, uint16_t *crc) { } crc16(crc, value, size); pos += size; - return true; + return false; } -void read_data(int &pos, uint8_t* value, uint16_t size, uint16_t *crc) { +bool read_data(int &pos, uint8_t* value, uint16_t size, uint16_t *crc) { for (int i = 0; i < size; i++) { value[i] = HAL_STM32F1_eeprom_content [pos + i]; } crc16(crc, value, size); pos += size; + return false; } } // PersistentStore:: diff --git a/Marlin/src/HAL/HAL_TEENSY35_36/persistent_store_impl.cpp b/Marlin/src/HAL/HAL_TEENSY35_36/persistent_store_impl.cpp index a50beb869f..f78a8ec4cd 100644 --- a/Marlin/src/HAL/HAL_TEENSY35_36/persistent_store_impl.cpp +++ b/Marlin/src/HAL/HAL_TEENSY35_36/persistent_store_impl.cpp @@ -28,17 +28,17 @@ bool write_data(int &pos, const uint8_t *value, uint16_t size, uint16_t *crc) { if (eeprom_read_byte(p) != v) { SERIAL_ECHO_START(); SERIAL_ECHOLNPGM(MSG_ERR_EEPROM_WRITE); - return false; + return true; } } crc16(crc, &v, 1); pos++; value++; }; - return true; + return false; } -void read_data(int &pos, uint8_t* value, uint16_t size, uint16_t *crc) { +bool read_data(int &pos, uint8_t* value, uint16_t size, uint16_t *crc) { do { uint8_t c = eeprom_read_byte((unsigned char*)pos); *value = c; @@ -46,6 +46,7 @@ void read_data(int &pos, uint8_t* value, uint16_t size, uint16_t *crc) { pos++; value++; } while (--size); + return false; } } // PersistentStore diff --git a/Marlin/src/HAL/persistent_store_api.h b/Marlin/src/HAL/persistent_store_api.h index 1d88d38f0a..ada9e0d88b 100644 --- a/Marlin/src/HAL/persistent_store_api.h +++ b/Marlin/src/HAL/persistent_store_api.h @@ -10,7 +10,7 @@ namespace PersistentStore { bool access_start(); bool access_finish(); bool write_data(int &pos, const uint8_t *value, uint16_t size, uint16_t *crc); -void read_data(int &pos, uint8_t* value, uint16_t size, uint16_t *crc); +bool read_data(int &pos, uint8_t* value, uint16_t size, uint16_t *crc); } // PersistentStore } // HAL diff --git a/Marlin/src/config/default/Configuration.h b/Marlin/src/config/default/Configuration.h index 51d3cdcfb4..7781008aca 100644 --- a/Marlin/src/config/default/Configuration.h +++ b/Marlin/src/config/default/Configuration.h @@ -854,12 +854,7 @@ * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) * A comprehensive bed leveling system combining the features and benefits * of other systems. UBL also includes integrated Mesh Generation, Mesh - * Validation and Mesh Editing systems. Currently, UBL is only checked out - * for Cartesian Printers. That said, it was primarily designed to correct - * poor quality Delta Printers. If you feel adventurous and have a Delta, - * please post an issue if something doesn't work correctly. Initially, - * you will need to set a reduced bed size so you have a rectangular area - * to test on. + * Validation and Mesh Editing systems. * * - MESH_BED_LEVELING * Probe a grid manually diff --git a/Marlin/src/config/examples/AlephObjects/TAZ4/Configuration.h b/Marlin/src/config/examples/AlephObjects/TAZ4/Configuration.h index 11a54ba0e5..d9d725b959 100644 --- a/Marlin/src/config/examples/AlephObjects/TAZ4/Configuration.h +++ b/Marlin/src/config/examples/AlephObjects/TAZ4/Configuration.h @@ -874,12 +874,7 @@ * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) * A comprehensive bed leveling system combining the features and benefits * of other systems. UBL also includes integrated Mesh Generation, Mesh - * Validation and Mesh Editing systems. Currently, UBL is only checked out - * for Cartesian Printers. That said, it was primarily designed to correct - * poor quality Delta Printers. If you feel adventurous and have a Delta, - * please post an issue if something doesn't work correctly. Initially, - * you will need to set a reduced bed size so you have a rectangular area - * to test on. + * Validation and Mesh Editing systems. * * - MESH_BED_LEVELING * Probe a grid manually diff --git a/Marlin/src/config/examples/AliExpress/CL-260/Configuration.h b/Marlin/src/config/examples/AliExpress/CL-260/Configuration.h index 15b025b41e..c85b0b01dc 100644 --- a/Marlin/src/config/examples/AliExpress/CL-260/Configuration.h +++ b/Marlin/src/config/examples/AliExpress/CL-260/Configuration.h @@ -854,12 +854,7 @@ * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) * A comprehensive bed leveling system combining the features and benefits * of other systems. UBL also includes integrated Mesh Generation, Mesh - * Validation and Mesh Editing systems. Currently, UBL is only checked out - * for Cartesian Printers. That said, it was primarily designed to correct - * poor quality Delta Printers. If you feel adventurous and have a Delta, - * please post an issue if something doesn't work correctly. Initially, - * you will need to set a reduced bed size so you have a rectangular area - * to test on. + * Validation and Mesh Editing systems. * * - MESH_BED_LEVELING * Probe a grid manually diff --git a/Marlin/src/config/examples/Anet/A6/Configuration.h b/Marlin/src/config/examples/Anet/A6/Configuration.h index 99888ef57e..2affc1ad91 100644 --- a/Marlin/src/config/examples/Anet/A6/Configuration.h +++ b/Marlin/src/config/examples/Anet/A6/Configuration.h @@ -973,12 +973,7 @@ * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) * A comprehensive bed leveling system combining the features and benefits * of other systems. UBL also includes integrated Mesh Generation, Mesh - * Validation and Mesh Editing systems. Currently, UBL is only checked out - * for Cartesian Printers. That said, it was primarily designed to correct - * poor quality Delta Printers. If you feel adventurous and have a Delta, - * please post an issue if something doesn't work correctly. Initially, - * you will need to set a reduced bed size so you have a rectangular area - * to test on. + * Validation and Mesh Editing systems. * * - MESH_BED_LEVELING * Probe a grid manually diff --git a/Marlin/src/config/examples/Anet/A8/Configuration.h b/Marlin/src/config/examples/Anet/A8/Configuration.h index 9c496942d9..d3fa860dd9 100644 --- a/Marlin/src/config/examples/Anet/A8/Configuration.h +++ b/Marlin/src/config/examples/Anet/A8/Configuration.h @@ -860,12 +860,7 @@ * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) * A comprehensive bed leveling system combining the features and benefits * of other systems. UBL also includes integrated Mesh Generation, Mesh - * Validation and Mesh Editing systems. Currently, UBL is only checked out - * for Cartesian Printers. That said, it was primarily designed to correct - * poor quality Delta Printers. If you feel adventurous and have a Delta, - * please post an issue if something doesn't work correctly. Initially, - * you will need to set a reduced bed size so you have a rectangular area - * to test on. + * Validation and Mesh Editing systems. * * - MESH_BED_LEVELING * Probe a grid manually diff --git a/Marlin/src/config/examples/BQ/Hephestos/Configuration.h b/Marlin/src/config/examples/BQ/Hephestos/Configuration.h index 10714fc5c4..d6f3d46c07 100644 --- a/Marlin/src/config/examples/BQ/Hephestos/Configuration.h +++ b/Marlin/src/config/examples/BQ/Hephestos/Configuration.h @@ -845,12 +845,7 @@ * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) * A comprehensive bed leveling system combining the features and benefits * of other systems. UBL also includes integrated Mesh Generation, Mesh - * Validation and Mesh Editing systems. Currently, UBL is only checked out - * for Cartesian Printers. That said, it was primarily designed to correct - * poor quality Delta Printers. If you feel adventurous and have a Delta, - * please post an issue if something doesn't work correctly. Initially, - * you will need to set a reduced bed size so you have a rectangular area - * to test on. + * Validation and Mesh Editing systems. * * - MESH_BED_LEVELING * Probe a grid manually diff --git a/Marlin/src/config/examples/BQ/Hephestos_2/Configuration.h b/Marlin/src/config/examples/BQ/Hephestos_2/Configuration.h index 00f9941eb6..d79e965322 100644 --- a/Marlin/src/config/examples/BQ/Hephestos_2/Configuration.h +++ b/Marlin/src/config/examples/BQ/Hephestos_2/Configuration.h @@ -855,12 +855,7 @@ * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) * A comprehensive bed leveling system combining the features and benefits * of other systems. UBL also includes integrated Mesh Generation, Mesh - * Validation and Mesh Editing systems. Currently, UBL is only checked out - * for Cartesian Printers. That said, it was primarily designed to correct - * poor quality Delta Printers. If you feel adventurous and have a Delta, - * please post an issue if something doesn't work correctly. Initially, - * you will need to set a reduced bed size so you have a rectangular area - * to test on. + * Validation and Mesh Editing systems. * * - MESH_BED_LEVELING * Probe a grid manually diff --git a/Marlin/src/config/examples/BQ/WITBOX/Configuration.h b/Marlin/src/config/examples/BQ/WITBOX/Configuration.h index b257776e74..4f20f1aff2 100644 --- a/Marlin/src/config/examples/BQ/WITBOX/Configuration.h +++ b/Marlin/src/config/examples/BQ/WITBOX/Configuration.h @@ -845,12 +845,7 @@ * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) * A comprehensive bed leveling system combining the features and benefits * of other systems. UBL also includes integrated Mesh Generation, Mesh - * Validation and Mesh Editing systems. Currently, UBL is only checked out - * for Cartesian Printers. That said, it was primarily designed to correct - * poor quality Delta Printers. If you feel adventurous and have a Delta, - * please post an issue if something doesn't work correctly. Initially, - * you will need to set a reduced bed size so you have a rectangular area - * to test on. + * Validation and Mesh Editing systems. * * - MESH_BED_LEVELING * Probe a grid manually diff --git a/Marlin/src/config/examples/Cartesio/Configuration.h b/Marlin/src/config/examples/Cartesio/Configuration.h index 9637705c12..6ebf0afdff 100644 --- a/Marlin/src/config/examples/Cartesio/Configuration.h +++ b/Marlin/src/config/examples/Cartesio/Configuration.h @@ -853,12 +853,7 @@ * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) * A comprehensive bed leveling system combining the features and benefits * of other systems. UBL also includes integrated Mesh Generation, Mesh - * Validation and Mesh Editing systems. Currently, UBL is only checked out - * for Cartesian Printers. That said, it was primarily designed to correct - * poor quality Delta Printers. If you feel adventurous and have a Delta, - * please post an issue if something doesn't work correctly. Initially, - * you will need to set a reduced bed size so you have a rectangular area - * to test on. + * Validation and Mesh Editing systems. * * - MESH_BED_LEVELING * Probe a grid manually diff --git a/Marlin/src/config/examples/Creality/CR-10/Configuration.h b/Marlin/src/config/examples/Creality/CR-10/Configuration.h index ddb8ecdccc..3b2029017d 100755 --- a/Marlin/src/config/examples/Creality/CR-10/Configuration.h +++ b/Marlin/src/config/examples/Creality/CR-10/Configuration.h @@ -864,12 +864,7 @@ * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) * A comprehensive bed leveling system combining the features and benefits * of other systems. UBL also includes integrated Mesh Generation, Mesh - * Validation and Mesh Editing systems. Currently, UBL is only checked out - * for Cartesian Printers. That said, it was primarily designed to correct - * poor quality Delta Printers. If you feel adventurous and have a Delta, - * please post an issue if something doesn't work correctly. Initially, - * you will need to set a reduced bed size so you have a rectangular area - * to test on. + * Validation and Mesh Editing systems. * * - MESH_BED_LEVELING * Probe a grid manually diff --git a/Marlin/src/config/examples/Felix/Configuration.h b/Marlin/src/config/examples/Felix/Configuration.h index bba14d3383..2af759131f 100644 --- a/Marlin/src/config/examples/Felix/Configuration.h +++ b/Marlin/src/config/examples/Felix/Configuration.h @@ -836,12 +836,7 @@ * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) * A comprehensive bed leveling system combining the features and benefits * of other systems. UBL also includes integrated Mesh Generation, Mesh - * Validation and Mesh Editing systems. Currently, UBL is only checked out - * for Cartesian Printers. That said, it was primarily designed to correct - * poor quality Delta Printers. If you feel adventurous and have a Delta, - * please post an issue if something doesn't work correctly. Initially, - * you will need to set a reduced bed size so you have a rectangular area - * to test on. + * Validation and Mesh Editing systems. * * - MESH_BED_LEVELING * Probe a grid manually diff --git a/Marlin/src/config/examples/Felix/DUAL/Configuration.h b/Marlin/src/config/examples/Felix/DUAL/Configuration.h index a37ba6f538..88942b7a24 100644 --- a/Marlin/src/config/examples/Felix/DUAL/Configuration.h +++ b/Marlin/src/config/examples/Felix/DUAL/Configuration.h @@ -836,12 +836,7 @@ * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) * A comprehensive bed leveling system combining the features and benefits * of other systems. UBL also includes integrated Mesh Generation, Mesh - * Validation and Mesh Editing systems. Currently, UBL is only checked out - * for Cartesian Printers. That said, it was primarily designed to correct - * poor quality Delta Printers. If you feel adventurous and have a Delta, - * please post an issue if something doesn't work correctly. Initially, - * you will need to set a reduced bed size so you have a rectangular area - * to test on. + * Validation and Mesh Editing systems. * * - MESH_BED_LEVELING * Probe a grid manually diff --git a/Marlin/src/config/examples/Folger Tech/i3-2020/Configuration.h b/Marlin/src/config/examples/Folger Tech/i3-2020/Configuration.h index fb2814b5d2..ca2eddf9b6 100644 --- a/Marlin/src/config/examples/Folger Tech/i3-2020/Configuration.h +++ b/Marlin/src/config/examples/Folger Tech/i3-2020/Configuration.h @@ -634,7 +634,7 @@ * Z Servo Probe, such as an endstop switch on a rotating arm. */ #define Z_ENDSTOP_SERVO_NR 0 // Defaults to SERVO 0 connector. -#define Z_SERVO_ANGLES {40,85} // Z Servo Deploy and Stow angles +#define Z_SERVO_ANGLES {40,95} // Z Servo Deploy and Stow angles /** * The BLTouch probe uses a Hall effect sensor and emulates a servo. @@ -851,12 +851,7 @@ * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) * A comprehensive bed leveling system combining the features and benefits * of other systems. UBL also includes integrated Mesh Generation, Mesh - * Validation and Mesh Editing systems. Currently, UBL is only checked out - * for Cartesian Printers. That said, it was primarily designed to correct - * poor quality Delta Printers. If you feel adventurous and have a Delta, - * please post an issue if something doesn't work correctly. Initially, - * you will need to set a reduced bed size so you have a rectangular area - * to test on. + * Validation and Mesh Editing systems. * * - MESH_BED_LEVELING * Probe a grid manually diff --git a/Marlin/src/config/examples/Geeetech/GT2560/Configuration.h b/Marlin/src/config/examples/Geeetech/GT2560/Configuration.h index 10ad0d9039..72b4bf5d2d 100644 --- a/Marlin/src/config/examples/Geeetech/GT2560/Configuration.h +++ b/Marlin/src/config/examples/Geeetech/GT2560/Configuration.h @@ -869,12 +869,7 @@ * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) * A comprehensive bed leveling system combining the features and benefits * of other systems. UBL also includes integrated Mesh Generation, Mesh - * Validation and Mesh Editing systems. Currently, UBL is only checked out - * for Cartesian Printers. That said, it was primarily designed to correct - * poor quality Delta Printers. If you feel adventurous and have a Delta, - * please post an issue if something doesn't work correctly. Initially, - * you will need to set a reduced bed size so you have a rectangular area - * to test on. + * Validation and Mesh Editing systems. * * - MESH_BED_LEVELING * Probe a grid manually diff --git a/Marlin/src/config/examples/Geeetech/I3_Pro_X-GT2560/Configuration.h b/Marlin/src/config/examples/Geeetech/I3_Pro_X-GT2560/Configuration.h index 2e6bcbfd71..7494ebb541 100644 --- a/Marlin/src/config/examples/Geeetech/I3_Pro_X-GT2560/Configuration.h +++ b/Marlin/src/config/examples/Geeetech/I3_Pro_X-GT2560/Configuration.h @@ -854,12 +854,7 @@ * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) * A comprehensive bed leveling system combining the features and benefits * of other systems. UBL also includes integrated Mesh Generation, Mesh - * Validation and Mesh Editing systems. Currently, UBL is only checked out - * for Cartesian Printers. That said, it was primarily designed to correct - * poor quality Delta Printers. If you feel adventurous and have a Delta, - * please post an issue if something doesn't work correctly. Initially, - * you will need to set a reduced bed size so you have a rectangular area - * to test on. + * Validation and Mesh Editing systems. * * - MESH_BED_LEVELING * Probe a grid manually diff --git a/Marlin/src/config/examples/Infitary/i3-M508/Configuration.h b/Marlin/src/config/examples/Infitary/i3-M508/Configuration.h index 1cb03e12d7..fb4442d431 100644 --- a/Marlin/src/config/examples/Infitary/i3-M508/Configuration.h +++ b/Marlin/src/config/examples/Infitary/i3-M508/Configuration.h @@ -858,12 +858,7 @@ * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) * A comprehensive bed leveling system combining the features and benefits * of other systems. UBL also includes integrated Mesh Generation, Mesh - * Validation and Mesh Editing systems. Currently, UBL is only checked out - * for Cartesian Printers. That said, it was primarily designed to correct - * poor quality Delta Printers. If you feel adventurous and have a Delta, - * please post an issue if something doesn't work correctly. Initially, - * you will need to set a reduced bed size so you have a rectangular area - * to test on. + * Validation and Mesh Editing systems. * * - MESH_BED_LEVELING * Probe a grid manually diff --git a/Marlin/src/config/examples/Malyan/M150/Configuration.h b/Marlin/src/config/examples/Malyan/M150/Configuration.h index 06777d404c..6f15182045 100644 --- a/Marlin/src/config/examples/Malyan/M150/Configuration.h +++ b/Marlin/src/config/examples/Malyan/M150/Configuration.h @@ -878,12 +878,7 @@ * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) * A comprehensive bed leveling system combining the features and benefits * of other systems. UBL also includes integrated Mesh Generation, Mesh - * Validation and Mesh Editing systems. Currently, UBL is only checked out - * for Cartesian Printers. That said, it was primarily designed to correct - * poor quality Delta Printers. If you feel adventurous and have a Delta, - * please post an issue if something doesn't work correctly. Initially, - * you will need to set a reduced bed size so you have a rectangular area - * to test on. + * Validation and Mesh Editing systems. * * - MESH_BED_LEVELING * Probe a grid manually diff --git a/Marlin/src/config/examples/Micromake/C1/basic/Configuration.h b/Marlin/src/config/examples/Micromake/C1/basic/Configuration.h index c13d230294..31ef9e5c28 100644 --- a/Marlin/src/config/examples/Micromake/C1/basic/Configuration.h +++ b/Marlin/src/config/examples/Micromake/C1/basic/Configuration.h @@ -853,12 +853,7 @@ * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) * A comprehensive bed leveling system combining the features and benefits * of other systems. UBL also includes integrated Mesh Generation, Mesh - * Validation and Mesh Editing systems. Currently, UBL is only checked out - * for Cartesian Printers. That said, it was primarily designed to correct - * poor quality Delta Printers. If you feel adventurous and have a Delta, - * please post an issue if something doesn't work correctly. Initially, - * you will need to set a reduced bed size so you have a rectangular area - * to test on. + * Validation and Mesh Editing systems. * * - MESH_BED_LEVELING * Probe a grid manually diff --git a/Marlin/src/config/examples/Micromake/C1/enhanced/Configuration.h b/Marlin/src/config/examples/Micromake/C1/enhanced/Configuration.h index 3854a372f5..53a15f2b73 100644 --- a/Marlin/src/config/examples/Micromake/C1/enhanced/Configuration.h +++ b/Marlin/src/config/examples/Micromake/C1/enhanced/Configuration.h @@ -853,12 +853,7 @@ * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) * A comprehensive bed leveling system combining the features and benefits * of other systems. UBL also includes integrated Mesh Generation, Mesh - * Validation and Mesh Editing systems. Currently, UBL is only checked out - * for Cartesian Printers. That said, it was primarily designed to correct - * poor quality Delta Printers. If you feel adventurous and have a Delta, - * please post an issue if something doesn't work correctly. Initially, - * you will need to set a reduced bed size so you have a rectangular area - * to test on. + * Validation and Mesh Editing systems. * * - MESH_BED_LEVELING * Probe a grid manually diff --git a/Marlin/src/config/examples/Mks/Sbase/Configuration.h b/Marlin/src/config/examples/Mks/Sbase/Configuration.h index 13d2aa58af..3775a46bc4 100644 --- a/Marlin/src/config/examples/Mks/Sbase/Configuration.h +++ b/Marlin/src/config/examples/Mks/Sbase/Configuration.h @@ -856,12 +856,7 @@ * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) * A comprehensive bed leveling system combining the features and benefits * of other systems. UBL also includes integrated Mesh Generation, Mesh - * Validation and Mesh Editing systems. Currently, UBL is only checked out - * for Cartesian Printers. That said, it was primarily designed to correct - * poor quality Delta Printers. If you feel adventurous and have a Delta, - * please post an issue if something doesn't work correctly. Initially, - * you will need to set a reduced bed size so you have a rectangular area - * to test on. + * Validation and Mesh Editing systems. * * - MESH_BED_LEVELING * Probe a grid manually diff --git a/Marlin/src/config/examples/RepRapWorld/Megatronics/Configuration.h b/Marlin/src/config/examples/RepRapWorld/Megatronics/Configuration.h index c9cae156df..876b0ba565 100644 --- a/Marlin/src/config/examples/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/src/config/examples/RepRapWorld/Megatronics/Configuration.h @@ -854,12 +854,7 @@ * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) * A comprehensive bed leveling system combining the features and benefits * of other systems. UBL also includes integrated Mesh Generation, Mesh - * Validation and Mesh Editing systems. Currently, UBL is only checked out - * for Cartesian Printers. That said, it was primarily designed to correct - * poor quality Delta Printers. If you feel adventurous and have a Delta, - * please post an issue if something doesn't work correctly. Initially, - * you will need to set a reduced bed size so you have a rectangular area - * to test on. + * Validation and Mesh Editing systems. * * - MESH_BED_LEVELING * Probe a grid manually diff --git a/Marlin/src/config/examples/RigidBot/Configuration.h b/Marlin/src/config/examples/RigidBot/Configuration.h index 8de0a2486e..54b0baad8a 100644 --- a/Marlin/src/config/examples/RigidBot/Configuration.h +++ b/Marlin/src/config/examples/RigidBot/Configuration.h @@ -852,12 +852,7 @@ * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) * A comprehensive bed leveling system combining the features and benefits * of other systems. UBL also includes integrated Mesh Generation, Mesh - * Validation and Mesh Editing systems. Currently, UBL is only checked out - * for Cartesian Printers. That said, it was primarily designed to correct - * poor quality Delta Printers. If you feel adventurous and have a Delta, - * please post an issue if something doesn't work correctly. Initially, - * you will need to set a reduced bed size so you have a rectangular area - * to test on. + * Validation and Mesh Editing systems. * * - MESH_BED_LEVELING * Probe a grid manually diff --git a/Marlin/src/config/examples/SCARA/Configuration.h b/Marlin/src/config/examples/SCARA/Configuration.h index 7e059fff81..ca568d2071 100644 --- a/Marlin/src/config/examples/SCARA/Configuration.h +++ b/Marlin/src/config/examples/SCARA/Configuration.h @@ -866,12 +866,7 @@ * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) * A comprehensive bed leveling system combining the features and benefits * of other systems. UBL also includes integrated Mesh Generation, Mesh - * Validation and Mesh Editing systems. Currently, UBL is only checked out - * for Cartesian Printers. That said, it was primarily designed to correct - * poor quality Delta Printers. If you feel adventurous and have a Delta, - * please post an issue if something doesn't work correctly. Initially, - * you will need to set a reduced bed size so you have a rectangular area - * to test on. + * Validation and Mesh Editing systems. * * - MESH_BED_LEVELING * Probe a grid manually diff --git a/Marlin/src/config/examples/Sanguinololu/Configuration.h b/Marlin/src/config/examples/Sanguinololu/Configuration.h index caa7c1a92d..0cfe682f49 100644 --- a/Marlin/src/config/examples/Sanguinololu/Configuration.h +++ b/Marlin/src/config/examples/Sanguinololu/Configuration.h @@ -885,12 +885,7 @@ * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) * A comprehensive bed leveling system combining the features and benefits * of other systems. UBL also includes integrated Mesh Generation, Mesh - * Validation and Mesh Editing systems. Currently, UBL is only checked out - * for Cartesian Printers. That said, it was primarily designed to correct - * poor quality Delta Printers. If you feel adventurous and have a Delta, - * please post an issue if something doesn't work correctly. Initially, - * you will need to set a reduced bed size so you have a rectangular area - * to test on. + * Validation and Mesh Editing systems. * * - MESH_BED_LEVELING * Probe a grid manually diff --git a/Marlin/src/config/examples/TinyBoy2/Configuration.h b/Marlin/src/config/examples/TinyBoy2/Configuration.h index bafe2defd5..1ea7d07a41 100644 --- a/Marlin/src/config/examples/TinyBoy2/Configuration.h +++ b/Marlin/src/config/examples/TinyBoy2/Configuration.h @@ -910,12 +910,7 @@ * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) * A comprehensive bed leveling system combining the features and benefits * of other systems. UBL also includes integrated Mesh Generation, Mesh - * Validation and Mesh Editing systems. Currently, UBL is only checked out - * for Cartesian Printers. That said, it was primarily designed to correct - * poor quality Delta Printers. If you feel adventurous and have a Delta, - * please post an issue if something doesn't work correctly. Initially, - * you will need to set a reduced bed size so you have a rectangular area - * to test on. + * Validation and Mesh Editing systems. * * - MESH_BED_LEVELING * Probe a grid manually diff --git a/Marlin/src/config/examples/Velleman/K8200/Configuration.h b/Marlin/src/config/examples/Velleman/K8200/Configuration.h index 26ec002ef0..d3e991860c 100644 --- a/Marlin/src/config/examples/Velleman/K8200/Configuration.h +++ b/Marlin/src/config/examples/Velleman/K8200/Configuration.h @@ -884,12 +884,7 @@ * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) * A comprehensive bed leveling system combining the features and benefits * of other systems. UBL also includes integrated Mesh Generation, Mesh - * Validation and Mesh Editing systems. Currently, UBL is only checked out - * for Cartesian Printers. That said, it was primarily designed to correct - * poor quality Delta Printers. If you feel adventurous and have a Delta, - * please post an issue if something doesn't work correctly. Initially, - * you will need to set a reduced bed size so you have a rectangular area - * to test on. + * Validation and Mesh Editing systems. * * - MESH_BED_LEVELING * Probe a grid manually diff --git a/Marlin/src/config/examples/Velleman/K8400/Configuration.h b/Marlin/src/config/examples/Velleman/K8400/Configuration.h index a5881f0518..2a2bd761df 100644 --- a/Marlin/src/config/examples/Velleman/K8400/Configuration.h +++ b/Marlin/src/config/examples/Velleman/K8400/Configuration.h @@ -854,12 +854,7 @@ * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) * A comprehensive bed leveling system combining the features and benefits * of other systems. UBL also includes integrated Mesh Generation, Mesh - * Validation and Mesh Editing systems. Currently, UBL is only checked out - * for Cartesian Printers. That said, it was primarily designed to correct - * poor quality Delta Printers. If you feel adventurous and have a Delta, - * please post an issue if something doesn't work correctly. Initially, - * you will need to set a reduced bed size so you have a rectangular area - * to test on. + * Validation and Mesh Editing systems. * * - MESH_BED_LEVELING * Probe a grid manually diff --git a/Marlin/src/config/examples/Velleman/K8400/Dual-head/Configuration.h b/Marlin/src/config/examples/Velleman/K8400/Dual-head/Configuration.h index f89d4365ed..f04b1b69d6 100644 --- a/Marlin/src/config/examples/Velleman/K8400/Dual-head/Configuration.h +++ b/Marlin/src/config/examples/Velleman/K8400/Dual-head/Configuration.h @@ -854,12 +854,7 @@ * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) * A comprehensive bed leveling system combining the features and benefits * of other systems. UBL also includes integrated Mesh Generation, Mesh - * Validation and Mesh Editing systems. Currently, UBL is only checked out - * for Cartesian Printers. That said, it was primarily designed to correct - * poor quality Delta Printers. If you feel adventurous and have a Delta, - * please post an issue if something doesn't work correctly. Initially, - * you will need to set a reduced bed size so you have a rectangular area - * to test on. + * Validation and Mesh Editing systems. * * - MESH_BED_LEVELING * Probe a grid manually diff --git a/Marlin/src/config/examples/adafruit/ST7565/Configuration.h b/Marlin/src/config/examples/adafruit/ST7565/Configuration.h index 6ba4e55b8f..90df7ea01e 100644 --- a/Marlin/src/config/examples/adafruit/ST7565/Configuration.h +++ b/Marlin/src/config/examples/adafruit/ST7565/Configuration.h @@ -854,12 +854,7 @@ * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) * A comprehensive bed leveling system combining the features and benefits * of other systems. UBL also includes integrated Mesh Generation, Mesh - * Validation and Mesh Editing systems. Currently, UBL is only checked out - * for Cartesian Printers. That said, it was primarily designed to correct - * poor quality Delta Printers. If you feel adventurous and have a Delta, - * please post an issue if something doesn't work correctly. Initially, - * you will need to set a reduced bed size so you have a rectangular area - * to test on. + * Validation and Mesh Editing systems. * * - MESH_BED_LEVELING * Probe a grid manually diff --git a/Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration.h b/Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration.h index 890c63b56d..ebfbd4c12c 100644 --- a/Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration.h +++ b/Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration.h @@ -978,12 +978,7 @@ * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) * A comprehensive bed leveling system combining the features and benefits * of other systems. UBL also includes integrated Mesh Generation, Mesh - * Validation and Mesh Editing systems. Currently, UBL is only checked out - * for Cartesian Printers. That said, it was primarily designed to correct - * poor quality Delta Printers. If you feel adventurous and have a Delta, - * please post an issue if something doesn't work correctly. Initially, - * you will need to set a reduced bed size so you have a rectangular area - * to test on. + * Validation and Mesh Editing systems. * * - MESH_BED_LEVELING * Probe a grid manually diff --git a/Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration.h b/Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration.h index 265e8cfd8e..2c30878dc6 100644 --- a/Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration.h +++ b/Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration.h @@ -978,12 +978,7 @@ * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) * A comprehensive bed leveling system combining the features and benefits * of other systems. UBL also includes integrated Mesh Generation, Mesh - * Validation and Mesh Editing systems. Currently, UBL is only checked out - * for Cartesian Printers. That said, it was primarily designed to correct - * poor quality Delta Printers. If you feel adventurous and have a Delta, - * please post an issue if something doesn't work correctly. Initially, - * you will need to set a reduced bed size so you have a rectangular area - * to test on. + * Validation and Mesh Editing systems. * * - MESH_BED_LEVELING * Probe a grid manually diff --git a/Marlin/src/config/examples/delta/generic/Configuration.h b/Marlin/src/config/examples/delta/generic/Configuration.h index 367e5d56cd..8b4d542288 100644 --- a/Marlin/src/config/examples/delta/generic/Configuration.h +++ b/Marlin/src/config/examples/delta/generic/Configuration.h @@ -965,12 +965,7 @@ * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) * A comprehensive bed leveling system combining the features and benefits * of other systems. UBL also includes integrated Mesh Generation, Mesh - * Validation and Mesh Editing systems. Currently, UBL is only checked out - * for Cartesian Printers. That said, it was primarily designed to correct - * poor quality Delta Printers. If you feel adventurous and have a Delta, - * please post an issue if something doesn't work correctly. Initially, - * you will need to set a reduced bed size so you have a rectangular area - * to test on. + * Validation and Mesh Editing systems. * * - MESH_BED_LEVELING * Probe a grid manually diff --git a/Marlin/src/config/examples/delta/kossel_mini/Configuration.h b/Marlin/src/config/examples/delta/kossel_mini/Configuration.h index 4abe865185..a997293726 100644 --- a/Marlin/src/config/examples/delta/kossel_mini/Configuration.h +++ b/Marlin/src/config/examples/delta/kossel_mini/Configuration.h @@ -968,12 +968,7 @@ * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) * A comprehensive bed leveling system combining the features and benefits * of other systems. UBL also includes integrated Mesh Generation, Mesh - * Validation and Mesh Editing systems. Currently, UBL is only checked out - * for Cartesian Printers. That said, it was primarily designed to correct - * poor quality Delta Printers. If you feel adventurous and have a Delta, - * please post an issue if something doesn't work correctly. Initially, - * you will need to set a reduced bed size so you have a rectangular area - * to test on. + * Validation and Mesh Editing systems. * * - MESH_BED_LEVELING * Probe a grid manually diff --git a/Marlin/src/config/examples/delta/kossel_pro/Configuration.h b/Marlin/src/config/examples/delta/kossel_pro/Configuration.h index 3c9b1aa819..9753ea1e6d 100644 --- a/Marlin/src/config/examples/delta/kossel_pro/Configuration.h +++ b/Marlin/src/config/examples/delta/kossel_pro/Configuration.h @@ -968,12 +968,7 @@ * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) * A comprehensive bed leveling system combining the features and benefits * of other systems. UBL also includes integrated Mesh Generation, Mesh - * Validation and Mesh Editing systems. Currently, UBL is only checked out - * for Cartesian Printers. That said, it was primarily designed to correct - * poor quality Delta Printers. If you feel adventurous and have a Delta, - * please post an issue if something doesn't work correctly. Initially, - * you will need to set a reduced bed size so you have a rectangular area - * to test on. + * Validation and Mesh Editing systems. * * - MESH_BED_LEVELING * Probe a grid manually diff --git a/Marlin/src/config/examples/delta/kossel_xl/Configuration.h b/Marlin/src/config/examples/delta/kossel_xl/Configuration.h index b8dd2e9779..9720fac4cf 100644 --- a/Marlin/src/config/examples/delta/kossel_xl/Configuration.h +++ b/Marlin/src/config/examples/delta/kossel_xl/Configuration.h @@ -977,12 +977,7 @@ * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) * A comprehensive bed leveling system combining the features and benefits * of other systems. UBL also includes integrated Mesh Generation, Mesh - * Validation and Mesh Editing systems. Currently, UBL is only checked out - * for Cartesian Printers. That said, it was primarily designed to correct - * poor quality Delta Printers. If you feel adventurous and have a Delta, - * please post an issue if something doesn't work correctly. Initially, - * you will need to set a reduced bed size so you have a rectangular area - * to test on. + * Validation and Mesh Editing systems. * * - MESH_BED_LEVELING * Probe a grid manually diff --git a/Marlin/src/config/examples/gCreate/gMax1.5+/Configuration.h b/Marlin/src/config/examples/gCreate/gMax1.5+/Configuration.h index 208deba0d3..a487f47549 100644 --- a/Marlin/src/config/examples/gCreate/gMax1.5+/Configuration.h +++ b/Marlin/src/config/examples/gCreate/gMax1.5+/Configuration.h @@ -868,12 +868,7 @@ * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) * A comprehensive bed leveling system combining the features and benefits * of other systems. UBL also includes integrated Mesh Generation, Mesh - * Validation and Mesh Editing systems. Currently, UBL is only checked out - * for Cartesian Printers. That said, it was primarily designed to correct - * poor quality Delta Printers. If you feel adventurous and have a Delta, - * please post an issue if something doesn't work correctly. Initially, - * you will need to set a reduced bed size so you have a rectangular area - * to test on. + * Validation and Mesh Editing systems. * * - MESH_BED_LEVELING * Probe a grid manually diff --git a/Marlin/src/config/examples/makibox/Configuration.h b/Marlin/src/config/examples/makibox/Configuration.h index 65dc05d554..12e7aa398a 100644 --- a/Marlin/src/config/examples/makibox/Configuration.h +++ b/Marlin/src/config/examples/makibox/Configuration.h @@ -857,12 +857,7 @@ * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) * A comprehensive bed leveling system combining the features and benefits * of other systems. UBL also includes integrated Mesh Generation, Mesh - * Validation and Mesh Editing systems. Currently, UBL is only checked out - * for Cartesian Printers. That said, it was primarily designed to correct - * poor quality Delta Printers. If you feel adventurous and have a Delta, - * please post an issue if something doesn't work correctly. Initially, - * you will need to set a reduced bed size so you have a rectangular area - * to test on. + * Validation and Mesh Editing systems. * * - MESH_BED_LEVELING * Probe a grid manually diff --git a/Marlin/src/config/examples/stm32f103ret6/Configuration.h b/Marlin/src/config/examples/stm32f103ret6/Configuration.h index c5b068c0a4..474403cef3 100644 --- a/Marlin/src/config/examples/stm32f103ret6/Configuration.h +++ b/Marlin/src/config/examples/stm32f103ret6/Configuration.h @@ -841,12 +841,7 @@ * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) * A comprehensive bed leveling system combining the features and benefits * of other systems. UBL also includes integrated Mesh Generation, Mesh - * Validation and Mesh Editing systems. Currently, UBL is only checked out - * for Cartesian Printers. That said, it was primarily designed to correct - * poor quality Delta Printers. If you feel adventurous and have a Delta, - * please post an issue if something doesn't work correctly. Initially, - * you will need to set a reduced bed size so you have a rectangular area - * to test on. + * Validation and Mesh Editing systems. * * - MESH_BED_LEVELING * Probe a grid manually diff --git a/Marlin/src/config/examples/tvrrug/Round2/Configuration.h b/Marlin/src/config/examples/tvrrug/Round2/Configuration.h index 6006913a94..934f165dcd 100644 --- a/Marlin/src/config/examples/tvrrug/Round2/Configuration.h +++ b/Marlin/src/config/examples/tvrrug/Round2/Configuration.h @@ -849,12 +849,7 @@ * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) * A comprehensive bed leveling system combining the features and benefits * of other systems. UBL also includes integrated Mesh Generation, Mesh - * Validation and Mesh Editing systems. Currently, UBL is only checked out - * for Cartesian Printers. That said, it was primarily designed to correct - * poor quality Delta Printers. If you feel adventurous and have a Delta, - * please post an issue if something doesn't work correctly. Initially, - * you will need to set a reduced bed size so you have a rectangular area - * to test on. + * Validation and Mesh Editing systems. * * - MESH_BED_LEVELING * Probe a grid manually diff --git a/Marlin/src/config/examples/wt150/Configuration.h b/Marlin/src/config/examples/wt150/Configuration.h index f113cbce51..95d99a6286 100644 --- a/Marlin/src/config/examples/wt150/Configuration.h +++ b/Marlin/src/config/examples/wt150/Configuration.h @@ -859,12 +859,7 @@ * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) * A comprehensive bed leveling system combining the features and benefits * of other systems. UBL also includes integrated Mesh Generation, Mesh - * Validation and Mesh Editing systems. Currently, UBL is only checked out - * for Cartesian Printers. That said, it was primarily designed to correct - * poor quality Delta Printers. If you feel adventurous and have a Delta, - * please post an issue if something doesn't work correctly. Initially, - * you will need to set a reduced bed size so you have a rectangular area - * to test on. + * Validation and Mesh Editing systems. * * - MESH_BED_LEVELING * Probe a grid manually diff --git a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp index 9c4f552160..74e26f8442 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp +++ b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp @@ -668,7 +668,7 @@ } if (parser.seen('T')) - display_map(parser.has_value() ? parser.value_int() : 0); + display_map(g29_map_type); LEAVE: diff --git a/Marlin/src/module/configuration_store.cpp b/Marlin/src/module/configuration_store.cpp index 4a37e477e8..99d9eb9f4d 100644 --- a/Marlin/src/module/configuration_store.cpp +++ b/Marlin/src/module/configuration_store.cpp @@ -632,12 +632,12 @@ void MarlinSettings::postprocess() { SERIAL_ECHOLNPGM(")"); #endif } + EEPROM_FINISH(); #if ENABLED(UBL_SAVE_ACTIVE_ON_M500) if (ubl.storage_slot >= 0) store_mesh(ubl.storage_slot); #endif - EEPROM_FINISH(); return !eeprom_error; } @@ -1073,14 +1073,21 @@ void MarlinSettings::postprocess() { } uint16_t crc = 0; + bool status; int pos = meshes_end - (slot + 1) * sizeof(ubl.z_values); - HAL::PersistentStore::write_data(pos, (uint8_t *)&ubl.z_values, sizeof(ubl.z_values), &crc); + HAL::PersistentStore::access_start(); + status = HAL::PersistentStore::write_data(pos, (uint8_t *)&ubl.z_values, sizeof(ubl.z_values), &crc); + HAL::PersistentStore::access_finish(); + + if (status) + SERIAL_PROTOCOL("?Unable to save mesh data.\n"); // Write crc to MAT along with other data, or just tack on to the beginning or end #if ENABLED(EEPROM_CHITCHAT) - SERIAL_PROTOCOLLNPAIR("Mesh saved in slot ", slot); + if (!status) + SERIAL_PROTOCOLLNPAIR("Mesh saved in slot ", slot); #endif #else @@ -1106,13 +1113,20 @@ void MarlinSettings::postprocess() { uint16_t crc = 0; int pos = meshes_end - (slot + 1) * sizeof(ubl.z_values); uint8_t * const dest = into ? (uint8_t*)into : (uint8_t*)&ubl.z_values; - HAL::PersistentStore::read_data(pos, dest, sizeof(ubl.z_values), &crc); + uint16_t status; - // Compare crc with crc from MAT, or read from end + HAL::PersistentStore::access_start(); + status = HAL::PersistentStore::read_data(pos, dest, sizeof(ubl.z_values), &crc); + HAL::PersistentStore::access_finish(); + + if (status) + SERIAL_PROTOCOL("?Unable to load mesh data.\n"); #if ENABLED(EEPROM_CHITCHAT) - SERIAL_PROTOCOLLNPAIR("Mesh loaded from slot ", slot); + else + SERIAL_PROTOCOLLNPAIR("Mesh loaded from slot ", slot); #endif + EEPROM_FINISH(); #else From 3986a84f77110643b5873a3bd8a748eb246e6f66 Mon Sep 17 00:00:00 2001 From: Luc Van Daele Date: Wed, 18 Oct 2017 21:03:17 +0200 Subject: [PATCH 3/5] boolval revisited (#8016) --- Marlin/src/gcode/calibrate/G33.cpp | 2 +- Marlin/src/gcode/eeprom/M500-M503.cpp | 2 +- Marlin/src/gcode/parser.h | 2 +- Marlin/src/gcode/probe/G30.cpp | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Marlin/src/gcode/calibrate/G33.cpp b/Marlin/src/gcode/calibrate/G33.cpp index 0b3d753130..5746c3c4de 100644 --- a/Marlin/src/gcode/calibrate/G33.cpp +++ b/Marlin/src/gcode/calibrate/G33.cpp @@ -161,7 +161,7 @@ void GcodeSuite::G33() { return; } - const bool towers_set = parser.boolval('T', true), + const bool towers_set = !parser.boolval('T'), stow_after_each = parser.boolval('E'), _0p_calibration = probe_points == 0, _1p_calibration = probe_points == 1, diff --git a/Marlin/src/gcode/eeprom/M500-M503.cpp b/Marlin/src/gcode/eeprom/M500-M503.cpp index 2809e34986..61f5aab4ae 100644 --- a/Marlin/src/gcode/eeprom/M500-M503.cpp +++ b/Marlin/src/gcode/eeprom/M500-M503.cpp @@ -51,7 +51,7 @@ void GcodeSuite::M502() { * M503: print settings currently in memory */ void GcodeSuite::M503() { - (void)settings.report(!parser.boolval('S', true)); + (void)settings.report(parser.boolval('S')); } #endif // !DISABLE_M503 diff --git a/Marlin/src/gcode/parser.h b/Marlin/src/gcode/parser.h index c829e66c98..e792c07a2e 100644 --- a/Marlin/src/gcode/parser.h +++ b/Marlin/src/gcode/parser.h @@ -294,7 +294,7 @@ public: // Provide simple value accessors with default option FORCE_INLINE static float floatval(const char c, const float dval=0.0) { return seenval(c) ? value_float() : dval; } - FORCE_INLINE static bool boolval(const char c, const bool dval=false) { return seen(c) ? value_bool() : dval; } + FORCE_INLINE static bool boolval(const char c) { return seenval(c) ? value_bool() : seen(c); } FORCE_INLINE static uint8_t byteval(const char c, const uint8_t dval=0) { return seenval(c) ? value_byte() : dval; } FORCE_INLINE static int16_t intval(const char c, const int16_t dval=0) { return seenval(c) ? value_int() : dval; } FORCE_INLINE static uint16_t ushortval(const char c, const uint16_t dval=0) { return seenval(c) ? value_ushort() : dval; } diff --git a/Marlin/src/gcode/probe/G30.cpp b/Marlin/src/gcode/probe/G30.cpp index e84b520158..b50227913f 100644 --- a/Marlin/src/gcode/probe/G30.cpp +++ b/Marlin/src/gcode/probe/G30.cpp @@ -36,7 +36,7 @@ * * X Probe X position (default current X) * Y Probe Y position (default current Y) - * S0 Leave the probe deployed + * E Engage the probe for each probe */ void GcodeSuite::G30() { const float xpos = parser.linearval('X', current_position[X_AXIS] + X_PROBE_OFFSET_FROM_EXTRUDER), @@ -51,7 +51,7 @@ void GcodeSuite::G30() { setup_for_endstop_or_probe_move(); - const float measured_z = probe_pt(xpos, ypos, parser.boolval('S', true), 1); + const float measured_z = probe_pt(xpos, ypos, parser.boolval('E'), 1); if (!isnan(measured_z)) { SERIAL_PROTOCOLPAIR("Bed X: ", FIXFLOAT(xpos)); From 348e5e3109e11613c42adb483ad1313074dadac3 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 18 Oct 2017 17:14:32 -0500 Subject: [PATCH 4/5] Simplify Cartesian probing boundaries Followup to #8012 --- Marlin/src/inc/Conditionals_post.h | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index a5d7c575ac..b9f5e7db15 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -921,18 +921,11 @@ #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 set limits - #if ENABLED(BED_CENTER_AT_0_0) - #define MIN_PROBE_X (max(X_PROBE_OFFSET_FROM_EXTRUDER, 0) - (X_BED_SIZE) / 2) - #define MIN_PROBE_Y (max(Y_PROBE_OFFSET_FROM_EXTRUDER, 0) - (Y_BED_SIZE) / 2) - #define MAX_PROBE_X (min(X_BED_SIZE + X_PROBE_OFFSET_FROM_EXTRUDER, X_BED_SIZE) - (X_BED_SIZE) / 2) - #define MAX_PROBE_Y (min(Y_BED_SIZE + Y_PROBE_OFFSET_FROM_EXTRUDER, Y_BED_SIZE) - (Y_BED_SIZE) / 2) - #else - #define MIN_PROBE_X (max(X_MIN_POS + X_PROBE_OFFSET_FROM_EXTRUDER, 0)) - #define MIN_PROBE_Y (max(Y_MIN_POS + Y_PROBE_OFFSET_FROM_EXTRUDER, 0)) - #define MAX_PROBE_X (min(X_MAX_POS + X_PROBE_OFFSET_FROM_EXTRUDER, X_BED_SIZE)) - #define MAX_PROBE_Y (min(Y_MAX_POS + Y_PROBE_OFFSET_FROM_EXTRUDER, Y_BED_SIZE)) - #endif + // Boundaries for Cartesian probing based on bed limits + #define MIN_PROBE_X (max(X_MIN_POS + X_PROBE_OFFSET_FROM_EXTRUDER, X_MIN_BED)) + #define MIN_PROBE_Y (max(Y_MIN_POS + Y_PROBE_OFFSET_FROM_EXTRUDER, Y_MIN_BED)) + #define MAX_PROBE_X (min(X_MAX_POS + X_PROBE_OFFSET_FROM_EXTRUDER, X_MAX_BED)) + #define MAX_PROBE_Y (min(Y_MAX_POS + Y_PROBE_OFFSET_FROM_EXTRUDER, Y_MAX_BED)) #endif // Stepper pulse duration, in cycles From 543935828134831a3129247fcfcf3cb071048011 Mon Sep 17 00:00:00 2001 From: Roxy-3D Date: Thu, 19 Oct 2017 10:44:45 -0500 Subject: [PATCH 5/5] Basic UBL operations working on 32-bit platforms (#8024) * 32-bit work for UBL * Update FT i3-2020 reference file --- .../HAL/HAL_LPC1768/persistent_store_impl.cpp | 4 +- .../Folger Tech/i3-2020/Configuration.h | 4 +- .../Folger Tech/i3-2020/Configuration_adv.h | 2 +- .../bedlevel/ubl/G26_Mesh_Validation_Tool.cpp | 2 +- Marlin/src/feature/bedlevel/ubl/ubl.h | 3 +- Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp | 133 ++++++++++++------ Marlin/src/gcode/bedlevel/ubl/M421.cpp | 2 +- Marlin/src/gcode/calibrate/M48.cpp | 8 +- Marlin/src/gcode/parser.h | 2 +- 9 files changed, 101 insertions(+), 59 deletions(-) diff --git a/Marlin/src/HAL/HAL_LPC1768/persistent_store_impl.cpp b/Marlin/src/HAL/HAL_LPC1768/persistent_store_impl.cpp index 222cb5b08a..c8aaa0f315 100644 --- a/Marlin/src/HAL/HAL_LPC1768/persistent_store_impl.cpp +++ b/Marlin/src/HAL/HAL_LPC1768/persistent_store_impl.cpp @@ -21,7 +21,7 @@ FIL eeprom_file; bool access_start() { UINT file_size = 0, bytes_written = 0; - const char eeprom_zero = 0xFF; + const char eeprom_erase_value = 0xFF; MSC_Aquire_Lock(); if (f_mount(&fat_fs, "", 1)) { MSC_Release_Lock(); @@ -35,7 +35,7 @@ bool access_start() { if (res == FR_OK) { f_lseek(&eeprom_file, file_size); while (file_size <= E2END && res == FR_OK) { - res = f_write(&eeprom_file, &eeprom_zero, 1, &bytes_written); + res = f_write(&eeprom_file, &eeprom_erase_value, 1, &bytes_written); file_size++; } } diff --git a/Marlin/src/config/examples/Folger Tech/i3-2020/Configuration.h b/Marlin/src/config/examples/Folger Tech/i3-2020/Configuration.h index ca2eddf9b6..3306873190 100644 --- a/Marlin/src/config/examples/Folger Tech/i3-2020/Configuration.h +++ b/Marlin/src/config/examples/Folger Tech/i3-2020/Configuration.h @@ -125,7 +125,7 @@ // Optional custom name for your RepStrap or other custom machine // Displayed in the LCD "Ready" message -#define CUSTOM_MACHINE_NAME "FT-2020 v3" +#define CUSTOM_MACHINE_NAME "FT-2020 v4" // Define this to set a unique identifier for this printer, (Used by some programs to differentiate between machines) // You can use an online service to generate a random UUID. (eg http://www.uuidgenerator.net/version4) @@ -1677,7 +1677,7 @@ // Servo deactivation // // With this option servos are powered only during movement, then turned off to prevent jitter. -#define DEACTIVATE_SERVOS_AFTER_MOVE +//#define DEACTIVATE_SERVOS_AFTER_MOVE /** * Filament Width Sensor diff --git a/Marlin/src/config/examples/Folger Tech/i3-2020/Configuration_adv.h b/Marlin/src/config/examples/Folger Tech/i3-2020/Configuration_adv.h index 1119045dcd..2822cee795 100644 --- a/Marlin/src/config/examples/Folger Tech/i3-2020/Configuration_adv.h +++ b/Marlin/src/config/examples/Folger Tech/i3-2020/Configuration_adv.h @@ -1338,7 +1338,7 @@ * For clients that use a fixed-width font (like OctoPrint), leave this set to 1.0. * Otherwise, adjust according to your client and font. */ -#define PROPORTIONAL_FONT_RATIO 1.5 +#define PROPORTIONAL_FONT_RATIO 2.2 /** * Spend 28 bytes of SRAM to optimize the GCode parser diff --git a/Marlin/src/feature/bedlevel/ubl/G26_Mesh_Validation_Tool.cpp b/Marlin/src/feature/bedlevel/ubl/G26_Mesh_Validation_Tool.cpp index 19d1a1b942..52b37e6a1b 100644 --- a/Marlin/src/feature/bedlevel/ubl/G26_Mesh_Validation_Tool.cpp +++ b/Marlin/src/feature/bedlevel/ubl/G26_Mesh_Validation_Tool.cpp @@ -143,7 +143,7 @@ // Private functions static uint16_t circle_flags[16], horizontal_mesh_line_flags[16], vertical_mesh_line_flags[16]; -float g26_e_axis_feedrate = 0.020, +float g26_e_axis_feedrate = 0.025, random_deviation = 0.0; static bool g26_retracted = false; // Track the retracted state of the nozzle so mismatched diff --git a/Marlin/src/feature/bedlevel/ubl/ubl.h b/Marlin/src/feature/bedlevel/ubl/ubl.h index 050a2dd664..20333895f4 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl.h +++ b/Marlin/src/feature/bedlevel/ubl/ubl.h @@ -141,7 +141,8 @@ class unified_bed_leveling { static void save_ubl_active_state_and_disable(); static void restore_ubl_active_state_and_leave(); static void display_map(const int); - static mesh_index_pair find_closest_mesh_point_of_type(const MeshPointType, const float&, const float&, const bool, uint16_t[16], bool); + static mesh_index_pair find_closest_mesh_point_of_type(const MeshPointType, const float&, const float&, const bool, uint16_t[16]); + static mesh_index_pair find_furthest_invalid_mesh_point(); static void reset(); static void invalidate(); static void set_all_mesh_points_to_value(const float); diff --git a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp index 74e26f8442..f1eb6b7f00 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp +++ b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp @@ -333,7 +333,7 @@ else { while (g29_repetition_cnt--) { if (cnt > 20) { cnt = 0; idle(); } - const mesh_index_pair location = find_closest_mesh_point_of_type(REAL, g29_x_pos, g29_y_pos, USE_NOZZLE_AS_REFERENCE, NULL, false); + const mesh_index_pair location = find_closest_mesh_point_of_type(REAL, g29_x_pos, g29_y_pos, USE_NOZZLE_AS_REFERENCE, NULL); if (location.x_index < 0) { // No more REACHABLE mesh points to invalidate, so we ASSUME the user // meant to invalidate the ENTIRE mesh, which cannot be done with @@ -529,7 +529,7 @@ } else { while (g29_repetition_cnt--) { // this only populates reachable mesh points near - const mesh_index_pair location = find_closest_mesh_point_of_type(INVALID, g29_x_pos, g29_y_pos, USE_NOZZLE_AS_REFERENCE, NULL, false); + const mesh_index_pair location = find_closest_mesh_point_of_type(INVALID, g29_x_pos, g29_y_pos, USE_NOZZLE_AS_REFERENCE, NULL); if (location.x_index < 0) { // No more REACHABLE INVALID mesh points to populate, so we ASSUME // user meant to populate ALL INVALID mesh points to value @@ -744,6 +744,8 @@ uint16_t max_iterations = GRID_MAX_POINTS; do { + if (do_ubl_mesh_map) display_map(g29_map_type); + #if ENABLED(NEWPANEL) if (ubl_lcd_clicked()) { SERIAL_PROTOCOLLNPGM("\nMesh only partially populated.\n"); @@ -757,7 +759,10 @@ } #endif - location = find_closest_mesh_point_of_type(INVALID, lx, ly, USE_PROBE_AS_REFERENCE, NULL, close_or_far); + if (close_or_far) + location = find_furthest_invalid_mesh_point(); + else + location = find_closest_mesh_point_of_type(INVALID, lx, ly, USE_PROBE_AS_REFERENCE, NULL); if (location.x_index >= 0) { // mesh point found and is reachable by probe const float rawx = mesh_index_to_xpos(location.x_index), @@ -767,8 +772,6 @@ z_values[location.x_index][location.y_index] = measured_z; } - if (do_ubl_mesh_map) display_map(g29_map_type); - } while (location.x_index >= 0 && --max_iterations); STOW_PROBE(); @@ -962,7 +965,7 @@ mesh_index_pair location; do { - location = find_closest_mesh_point_of_type(INVALID, lx, ly, USE_NOZZLE_AS_REFERENCE, NULL, false); + location = find_closest_mesh_point_of_type(INVALID, lx, ly, USE_NOZZLE_AS_REFERENCE, NULL); // It doesn't matter if the probe can't reach the NAN location. This is a manual probe. if (location.x_index < 0 && location.y_index < 0) continue; @@ -1289,7 +1292,7 @@ */ void unified_bed_leveling::g29_eeprom_dump() { unsigned char cccc; - uint16_t kkkk; + unsigned int kkkk; // Needs to be of unspecfied size to compile clean on all platforms SERIAL_ECHO_START(); SERIAL_ECHOLNPGM("EEPROM Dump:"); @@ -1299,7 +1302,7 @@ SERIAL_ECHOPGM(": "); for (uint16_t j = 0; j < 16; j++) { kkkk = i + j; - eeprom_read_block(&cccc, (void *)kkkk, 1); + eeprom_read_block(&cccc, (const void *) kkkk, sizeof(unsigned char)); print_hex_byte(cccc); SERIAL_ECHO(' '); } @@ -1345,18 +1348,84 @@ z_values[x][y] -= tmp_z_values[x][y]; } - mesh_index_pair unified_bed_leveling::find_closest_mesh_point_of_type(const MeshPointType type, const float &lx, const float &ly, const bool probe_as_reference, uint16_t bits[16], const bool far_flag) { + + mesh_index_pair unified_bed_leveling::find_furthest_invalid_mesh_point() { + + bool found_a_NAN = false; + bool found_a_real = false; mesh_index_pair out_mesh; out_mesh.x_index = out_mesh.y_index = -1; + out_mesh.distance = -99999.99; + + for (int8_t i = 0; i < GRID_MAX_POINTS_X; i++) { + for (int8_t j = 0; j < GRID_MAX_POINTS_Y; j++) { + + if ( isnan(z_values[i][j])) { // Check to see if this location holds an invalid mesh point + + const float mx = mesh_index_to_xpos(i), + my = mesh_index_to_ypos(j); + + if ( !position_is_reachable_by_probe_raw_xy(mx, my)) // make sure the probe can get to the mesh point + continue; + + found_a_NAN = true; + + int8_t closest_x=-1, closest_y=-1; + float d1, d2 = 99999.9; + for (int8_t k = 0; k < GRID_MAX_POINTS_X; k++) { + for (int8_t l = 0; l < GRID_MAX_POINTS_Y; l++) { + if (!isnan(z_values[k][l])) { + found_a_real = true; + + // Add in a random weighting factor that scrambles the probing of the + // last half of the mesh (when every unprobed mesh point is one index + // from a probed location). + + d1 = HYPOT(i - k, j - l) + (1.0 / ((millis() % 47) + 13)); + + if (d1 < d2) { // found a closer distance from invalid mesh point at (i,j) to defined mesh point at (k,l) + d2 = d1; // found a closer location with + closest_x = i; // an assigned mesh point value + closest_y = j; + } + } + } + } + + // + // at this point d2 should have the closest defined mesh point to invalid mesh point (i,j) + // + + if (found_a_real && (closest_x >= 0) && (d2 > out_mesh.distance)) { + out_mesh.distance = d2; // found an invalid location with a greater distance + out_mesh.x_index = closest_x; // to a defined mesh point + out_mesh.y_index = closest_y; + } + } + } // for j + } // for i + + if (!found_a_real && found_a_NAN) { // if the mesh is totally unpopulated, start the probing + out_mesh.x_index = GRID_MAX_POINTS_X / 2; + out_mesh.y_index = GRID_MAX_POINTS_Y / 2; + out_mesh.distance = 1.0; + } + return out_mesh; + } + + mesh_index_pair unified_bed_leveling::find_closest_mesh_point_of_type(const MeshPointType type, const float &lx, const float &ly, const bool probe_as_reference, uint16_t bits[16]) { + mesh_index_pair out_mesh; + out_mesh.x_index = out_mesh.y_index = -1; + out_mesh.distance = -99999.9; // Get our reference position. Either the nozzle or probe location. const float px = RAW_X_POSITION(lx) - (probe_as_reference == USE_PROBE_AS_REFERENCE ? X_PROBE_OFFSET_FROM_EXTRUDER : 0), py = RAW_Y_POSITION(ly) - (probe_as_reference == USE_PROBE_AS_REFERENCE ? Y_PROBE_OFFSET_FROM_EXTRUDER : 0); - float best_so_far = far_flag ? -99999.99 : 99999.99; + float best_so_far = 99999.99; - for (uint8_t i = 0; i < GRID_MAX_POINTS_X; i++) { - for (uint8_t j = 0; j < GRID_MAX_POINTS_Y; j++) { + for (int8_t i = 0; i < GRID_MAX_POINTS_X; i++) { + for (int8_t j = 0; j < GRID_MAX_POINTS_Y; j++) { if ( (type == INVALID && isnan(z_values[i][j])) // Check to see if this location holds the right thing || (type == REAL && !isnan(z_values[i][j])) @@ -1376,35 +1445,14 @@ continue; // Reachable. Check if it's the best_so_far location to the nozzle. - // Add in a weighting factor that considers the current location of the nozzle. float distance = HYPOT(px - mx, py - my); - /** - * If doing the far_flag action, we want to be as far as possible - * from the starting point and from any other probed points. We - * want the next point spread out and filling in any blank spaces - * in the mesh. So we add in some of the distance to every probed - * point we can find. - */ - if (far_flag) { - for (uint8_t k = 0; k < GRID_MAX_POINTS_X; k++) { - for (uint8_t l = 0; l < GRID_MAX_POINTS_Y; l++) { - if (i != k && j != l && !isnan(z_values[k][l])) { - //distance += pow((float) abs(i - k) * (MESH_X_DIST), 2) + pow((float) abs(j - l) * (MESH_Y_DIST), 2); // working here - distance += HYPOT(MESH_X_DIST, MESH_Y_DIST) / log(HYPOT((i - k) * (MESH_X_DIST) + .001, (j - l) * (MESH_Y_DIST)) + .001); - } - } - } - } - else // factor in the distance from the current location for the normal case // so the nozzle isn't running all over the bed. - distance += HYPOT(raw_x - mx, raw_y - my) * 0.1; - - // if far_flag, look for farthest point - if (far_flag == (distance > best_so_far) && distance != best_so_far) { - best_so_far = distance; // We found a closer/farther location with + distance += HYPOT(raw_x - mx, raw_y - my) * 0.1; + if (distance < best_so_far) { + best_so_far = distance; // We found a closer location with out_mesh.x_index = i; // the specified type of mesh value. out_mesh.y_index = j; out_mesh.distance = best_so_far; @@ -1412,7 +1460,6 @@ } } // for j } // for i - return out_mesh; } @@ -1448,7 +1495,7 @@ uint16_t not_done[16]; memset(not_done, 0xFF, sizeof(not_done)); do { - location = find_closest_mesh_point_of_type(SET_IN_BITMAP, lx, ly, USE_NOZZLE_AS_REFERENCE, not_done, false); + location = find_closest_mesh_point_of_type(SET_IN_BITMAP, lx, ly, USE_NOZZLE_AS_REFERENCE, not_done); if (location.x_index < 0) break; // stop when we can't find any more reachable points. @@ -1572,16 +1619,10 @@ info3 PROGMEM = { GRID_MAX_POINTS_X - 1, 0, 0, GRID_MAX_POINTS_Y, true }; // Right side of the mesh looking left static const smart_fill_info * const info[] PROGMEM = { &info0, &info1, &info2, &info3 }; - // static const smart_fill_info info[] PROGMEM = { - // { 0, GRID_MAX_POINTS_X, 0, GRID_MAX_POINTS_Y - 2, false } PROGMEM, // Bottom of the mesh looking up - // { 0, GRID_MAX_POINTS_X, GRID_MAX_POINTS_Y - 1, 0, false } PROGMEM, // Top of the mesh looking down - // { 0, GRID_MAX_POINTS_X - 2, 0, GRID_MAX_POINTS_Y, true } PROGMEM, // Left side of the mesh looking right - // { GRID_MAX_POINTS_X - 1, 0, 0, GRID_MAX_POINTS_Y, true } PROGMEM // Right side of the mesh looking left - // }; for (uint8_t i = 0; i < COUNT(info); ++i) { const smart_fill_info *f = (smart_fill_info*)pgm_read_ptr(&info[i]); - const int8_t sx = pgm_read_word(&f->sx), sy = pgm_read_word(&f->sy), - ex = pgm_read_word(&f->ex), ey = pgm_read_word(&f->ey); + const int8_t sx = pgm_read_byte(&f->sx), sy = pgm_read_byte(&f->sy), + ex = pgm_read_byte(&f->ex), ey = pgm_read_byte(&f->ey); if (pgm_read_byte(&f->yfirst)) { const int8_t dir = ex > sx ? 1 : -1; for (uint8_t y = sy; y != ey; ++y) diff --git a/Marlin/src/gcode/bedlevel/ubl/M421.cpp b/Marlin/src/gcode/bedlevel/ubl/M421.cpp index 07ca280e11..83c8cbbc39 100644 --- a/Marlin/src/gcode/bedlevel/ubl/M421.cpp +++ b/Marlin/src/gcode/bedlevel/ubl/M421.cpp @@ -49,7 +49,7 @@ void GcodeSuite::M421() { hasQ = !hasZ && parser.seen('Q'); if (hasC) { - const mesh_index_pair location = ubl.find_closest_mesh_point_of_type(REAL, current_position[X_AXIS], current_position[Y_AXIS], USE_NOZZLE_AS_REFERENCE, NULL, false); + const mesh_index_pair location = ubl.find_closest_mesh_point_of_type(REAL, current_position[X_AXIS], current_position[Y_AXIS], USE_NOZZLE_AS_REFERENCE, NULL); ix = location.x_index; iy = location.y_index; } diff --git a/Marlin/src/gcode/calibrate/M48.cpp b/Marlin/src/gcode/calibrate/M48.cpp index a910f02ee6..ced53d47ed 100644 --- a/Marlin/src/gcode/calibrate/M48.cpp +++ b/Marlin/src/gcode/calibrate/M48.cpp @@ -137,13 +137,13 @@ void GcodeSuite::M48() { for (uint8_t n = 0; n < n_samples; n++) { if (n_legs) { const int dir = (random(0, 10) > 5.0) ? -1 : 1; // clockwise or counter clockwise - float angle = random(0.0, 360.0); + float angle = random(0, 360); const float radius = random( #if ENABLED(DELTA) - 0.1250000000 * (DELTA_PROBEABLE_RADIUS), - 0.3333333333 * (DELTA_PROBEABLE_RADIUS) + (int) (0.1250000000 * (DELTA_PROBEABLE_RADIUS)), + (int) (0.3333333333 * (DELTA_PROBEABLE_RADIUS)) #else - 5.0, 0.125 * min(X_BED_SIZE, Y_BED_SIZE) + (int) 5.0, (int) (0.125 * min(X_BED_SIZE, Y_BED_SIZE)) #endif ); diff --git a/Marlin/src/gcode/parser.h b/Marlin/src/gcode/parser.h index e792c07a2e..a8b7a54e8d 100644 --- a/Marlin/src/gcode/parser.h +++ b/Marlin/src/gcode/parser.h @@ -294,7 +294,7 @@ public: // Provide simple value accessors with default option FORCE_INLINE static float floatval(const char c, const float dval=0.0) { return seenval(c) ? value_float() : dval; } - FORCE_INLINE static bool boolval(const char c) { return seenval(c) ? value_bool() : seen(c); } + FORCE_INLINE static bool boolval(const char c) { return seenval(c) ? value_bool() : seen(c); } FORCE_INLINE static uint8_t byteval(const char c, const uint8_t dval=0) { return seenval(c) ? value_byte() : dval; } FORCE_INLINE static int16_t intval(const char c, const int16_t dval=0) { return seenval(c) ? value_int() : dval; } FORCE_INLINE static uint16_t ushortval(const char c, const uint16_t dval=0) { return seenval(c) ? value_ushort() : dval; }