From 8b504021bcf1cea0e5aeb2f238fa0a0de8075e18 Mon Sep 17 00:00:00 2001 From: Thomas Basler Date: Sun, 3 Feb 2019 02:17:29 +0100 Subject: [PATCH] Made G38 working --- Marlin/endstops.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Marlin/endstops.cpp b/Marlin/endstops.cpp index 39fbc8013..6b4d76347 100644 --- a/Marlin/endstops.cpp +++ b/Marlin/endstops.cpp @@ -407,6 +407,11 @@ void Endstops::update() { if (G38_move) UPDATE_ENDSTOP_BIT(Z, MIN_PROBE); #endif + #if ENABLED(G38_PROBE_TARGET) && (ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) && PIN_EXISTS(Z_MIN)) && !(CORE_IS_XY || CORE_IS_XZ) + // If G38 command is active check Z_MIN_PROBE for ALL movement + if (G38_move) UPDATE_ENDSTOP_BIT(Z, MIN); + #endif + // With Dual X, endstops are only checked in the homing direction for the active extruder #if ENABLED(DUAL_X_CARRIAGE) #define E0_ACTIVE stepper.movement_extruder() == 0 @@ -572,10 +577,11 @@ void Endstops::update() { } \ }while(0) - #if ENABLED(G38_PROBE_TARGET) && PIN_EXISTS(Z_MIN_PROBE) && !(CORE_IS_XY || CORE_IS_XZ) + #if ENABLED(G38_PROBE_TARGET) && (PIN_EXISTS(Z_MIN_PROBE) || (ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) && PIN_EXISTS(Z_MIN))) && !(CORE_IS_XY || CORE_IS_XZ) // If G38 command is active check Z_MIN_PROBE for ALL movement + if (G38_move) { - if (TEST_ENDSTOP(_ENDSTOP(Z, MIN_PROBE))) { + if (TEST_ENDSTOP(_ENDSTOP(Z, MIN_PROBE)) || TEST_ENDSTOP(_ENDSTOP(Z, MIN))) { if (stepper.axis_is_moving(X_AXIS)) { _ENDSTOP_HIT(X, MIN); planner.endstop_triggered(X_AXIS); } else if (stepper.axis_is_moving(Y_AXIS)) { _ENDSTOP_HIT(Y, MIN); planner.endstop_triggered(Y_AXIS); } else if (stepper.axis_is_moving(Z_AXIS)) { _ENDSTOP_HIT(Z, MIN); planner.endstop_triggered(Z_AXIS); }