Made G38 working

This commit is contained in:
Thomas Basler 2019-02-03 02:17:29 +01:00
parent d8d4eeb6a0
commit 8b504021bc
1 changed files with 8 additions and 2 deletions

View File

@ -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); }