From 3f4636e916f0c2635f83f457fa662b90fc3a8809 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 13 Nov 2019 02:53:11 -0600 Subject: [PATCH] "nozzle_to_probe_offset" is obsolete --- Marlin/src/inc/Conditionals_post.h | 21 ++++++++++----------- Marlin/src/module/configuration_store.cpp | 3 --- Marlin/src/module/probe.h | 2 -- 3 files changed, 10 insertions(+), 16 deletions(-) diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 0cbb35776e..f328775126 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -1367,6 +1367,9 @@ #define XY_PROBE_SPEED 4000 #endif #endif + #ifndef NOZZLE_TO_PROBE_OFFSET + #define NOZZLE_TO_PROBE_OFFSET { 0, 0, 0 } + #endif #else #undef NOZZLE_TO_PROBE_OFFSET #endif @@ -1477,18 +1480,14 @@ #define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE #endif -#ifndef NOZZLE_TO_PROBE_OFFSET - #define NOZZLE_TO_PROBE_OFFSET { 0, 0, 0 } -#endif - #if ENABLED(DELTA) /** * Delta radius/rod trimmers/angle trimmers */ #define _PROBE_RADIUS (DELTA_PRINTABLE_RADIUS - (MIN_PROBE_EDGE)) #ifndef DELTA_CALIBRATION_RADIUS - #ifdef NOZZLE_TO_PROBE_OFFSET - #define DELTA_CALIBRATION_RADIUS (DELTA_PRINTABLE_RADIUS - _MAX(ABS(nozzle_to_probe_offset.x), ABS(nozzle_to_probe_offset.y), ABS(MIN_PROBE_EDGE))) + #if HAS_BED_PROBE + #define DELTA_CALIBRATION_RADIUS (DELTA_PRINTABLE_RADIUS - _MAX(ABS(probe_offset.x), ABS(probe_offset.y), ABS(MIN_PROBE_EDGE))) #else #define DELTA_CALIBRATION_RADIUS _PROBE_RADIUS #endif @@ -1543,16 +1542,16 @@ #define _MESH_MAX_Y (Y_MAX_BED - (MESH_INSET)) #else // Boundaries for Cartesian probing based on set limits - #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) + #if ANY(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL, PROBE_MANUALLY) #define _MESH_MIN_X (_MAX(X_MIN_BED + MESH_INSET, X_MIN_POS)) // UBL is careful not to probe off the bed. It does not #define _MESH_MIN_Y (_MAX(Y_MIN_BED + MESH_INSET, Y_MIN_POS)) // need NOZZLE_TO_PROBE_OFFSET in the mesh dimensions #define _MESH_MAX_X (_MIN(X_MAX_BED - (MESH_INSET), X_MAX_POS)) #define _MESH_MAX_Y (_MIN(Y_MAX_BED - (MESH_INSET), Y_MAX_POS)) #else - #define _MESH_MIN_X (_MAX(X_MIN_BED + MESH_INSET, X_MIN_POS + nozzle_to_probe_offset.x)) - #define _MESH_MIN_Y (_MAX(Y_MIN_BED + MESH_INSET, Y_MIN_POS + nozzle_to_probe_offset.y)) - #define _MESH_MAX_X (_MIN(X_MAX_BED - (MESH_INSET), X_MAX_POS + nozzle_to_probe_offset.x)) - #define _MESH_MAX_Y (_MIN(Y_MAX_BED - (MESH_INSET), Y_MAX_POS + nozzle_to_probe_offset.y)) + #define _MESH_MIN_X (_MAX(X_MIN_BED + MESH_INSET, X_MIN_POS + probe_offset.x)) + #define _MESH_MIN_Y (_MAX(Y_MIN_BED + MESH_INSET, Y_MIN_POS + probe_offset.y)) + #define _MESH_MAX_X (_MIN(X_MAX_BED - (MESH_INSET), X_MAX_POS + probe_offset.x)) + #define _MESH_MAX_Y (_MIN(Y_MAX_BED - (MESH_INSET), Y_MAX_POS + probe_offset.y)) #endif #endif diff --git a/Marlin/src/module/configuration_store.cpp b/Marlin/src/module/configuration_store.cpp index 1341a87d64..84921d8b34 100644 --- a/Marlin/src/module/configuration_store.cpp +++ b/Marlin/src/module/configuration_store.cpp @@ -2344,9 +2344,6 @@ void MarlinSettings::reset() { #endif #if HAS_BED_PROBE - #ifndef NOZZLE_TO_PROBE_OFFSET - #define NOZZLE_TO_PROBE_OFFSET { 0, 0, 0 } - #endif constexpr float dpo[XYZ] = NOZZLE_TO_PROBE_OFFSET; static_assert(COUNT(dpo) == 3, "NOZZLE_TO_PROBE_OFFSET must contain offsets for X, Y, and Z."); LOOP_XYZ(a) probe_offset[a] = dpo[a]; diff --git a/Marlin/src/module/probe.h b/Marlin/src/module/probe.h index 64363ea9e0..36d3d6618b 100644 --- a/Marlin/src/module/probe.h +++ b/Marlin/src/module/probe.h @@ -29,8 +29,6 @@ #if HAS_BED_PROBE - constexpr xyz_pos_t nozzle_to_probe_offset = NOZZLE_TO_PROBE_OFFSET; - extern xyz_pos_t probe_offset; bool set_probe_deployed(const bool deploy);