From 296a2ad7e45d88a10db4b3305ea183e5c0c177a5 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 24 Nov 2020 17:38:13 -0600 Subject: [PATCH] Consistent Probe XY offset type --- Marlin/src/gcode/calibrate/G76_M192_M871.cpp | 2 +- Marlin/src/module/probe.cpp | 2 +- Marlin/src/module/probe.h | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Marlin/src/gcode/calibrate/G76_M192_M871.cpp b/Marlin/src/gcode/calibrate/G76_M192_M871.cpp index 38f17869fb..8ffada5c03 100644 --- a/Marlin/src/gcode/calibrate/G76_M192_M871.cpp +++ b/Marlin/src/gcode/calibrate/G76_M192_M871.cpp @@ -144,7 +144,7 @@ void GcodeSuite::G76() { const xyz_pos_t parkpos = temp_comp.park_point, probe_pos_xyz = xyz_pos_t(temp_comp.measure_point) + xyz_pos_t({ 0.0f, 0.0f, PTC_PROBE_HEATING_OFFSET }), - noz_pos_xyz = probe_pos_xyz - xy_pos_t(probe.offset_xy); // Nozzle position based on probe position + noz_pos_xyz = probe_pos_xyz - probe.offset_xy; // Nozzle position based on probe position if (do_bed_cal || do_probe_cal) { // Ensure park position is reachable diff --git a/Marlin/src/module/probe.cpp b/Marlin/src/module/probe.cpp index ff80063d65..f02b909150 100644 --- a/Marlin/src/module/probe.cpp +++ b/Marlin/src/module/probe.cpp @@ -89,7 +89,7 @@ Probe probe; xyz_pos_t Probe::offset; // Initialized by settings.load() #if HAS_PROBE_XY_OFFSET - const xyz_pos_t &Probe::offset_xy = Probe::offset; + const xy_pos_t &Probe::offset_xy = xy_pos_t(Probe::offset); #endif #if ENABLED(Z_PROBE_SLED) diff --git a/Marlin/src/module/probe.h b/Marlin/src/module/probe.h index 63229242b5..cac106fed6 100644 --- a/Marlin/src/module/probe.h +++ b/Marlin/src/module/probe.h @@ -112,9 +112,9 @@ public: FORCE_INLINE static bool good_bounds(const xy_pos_t &lf, const xy_pos_t &rb) { return ( #if IS_KINEMATIC - can_reach(lf.x, 0) && can_reach(rb.x, 0) && can_reach(0, lf.y) && can_reach(0, rb.y) + can_reach(lf.x, 0) && can_reach(rb.x, 0) && can_reach(0, lf.y) && can_reach(0, rb.y) #else - can_reach(lf) && can_reach(rb) + can_reach(lf) && can_reach(rb) #endif ); } @@ -122,7 +122,7 @@ public: // Use offset_xy for read only access // More optimal the XY offset is known to always be zero. #if HAS_PROBE_XY_OFFSET - static const xyz_pos_t &offset_xy; + static const xy_pos_t &offset_xy; #else static constexpr xy_pos_t offset_xy = xy_pos_t({ 0, 0 }); // See #16767 #endif