|
|
@ -289,7 +289,7 @@ void enable_endstops(bool check) { check_endstops = check; }
|
|
|
|
// Check endstops
|
|
|
|
// Check endstops
|
|
|
|
inline void update_endstops() {
|
|
|
|
inline void update_endstops() {
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef Z_DUAL_ENDSTOPS
|
|
|
|
#if ENABLED(Z_DUAL_ENDSTOPS)
|
|
|
|
uint16_t
|
|
|
|
uint16_t
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
byte
|
|
|
|
byte
|
|
|
@ -317,12 +317,12 @@ inline void update_endstops() {
|
|
|
|
step_events_completed = current_block->step_event_count; \
|
|
|
|
step_events_completed = current_block->step_event_count; \
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef COREXY
|
|
|
|
#if ENABLED(COREXY)
|
|
|
|
// Head direction in -X axis for CoreXY bots.
|
|
|
|
// Head direction in -X axis for CoreXY bots.
|
|
|
|
// If DeltaX == -DeltaY, the movement is only in Y axis
|
|
|
|
// If DeltaX == -DeltaY, the movement is only in Y axis
|
|
|
|
if ((current_block->steps[A_AXIS] != current_block->steps[B_AXIS]) || (TEST(out_bits, A_AXIS) == TEST(out_bits, B_AXIS))) {
|
|
|
|
if ((current_block->steps[A_AXIS] != current_block->steps[B_AXIS]) || (TEST(out_bits, A_AXIS) == TEST(out_bits, B_AXIS))) {
|
|
|
|
if (TEST(out_bits, X_HEAD))
|
|
|
|
if (TEST(out_bits, X_HEAD))
|
|
|
|
#elif defined(COREXZ)
|
|
|
|
#elif ENABLED(COREXZ)
|
|
|
|
// Head direction in -X axis for CoreXZ bots.
|
|
|
|
// Head direction in -X axis for CoreXZ bots.
|
|
|
|
// If DeltaX == -DeltaZ, the movement is only in Z axis
|
|
|
|
// If DeltaX == -DeltaZ, the movement is only in Z axis
|
|
|
|
if ((current_block->steps[A_AXIS] != current_block->steps[C_AXIS]) || (TEST(out_bits, A_AXIS) == TEST(out_bits, C_AXIS))) {
|
|
|
|
if ((current_block->steps[A_AXIS] != current_block->steps[C_AXIS]) || (TEST(out_bits, A_AXIS) == TEST(out_bits, C_AXIS))) {
|
|
|
@ -331,7 +331,7 @@ inline void update_endstops() {
|
|
|
|
if (TEST(out_bits, X_AXIS)) // stepping along -X axis (regular Cartesian bot)
|
|
|
|
if (TEST(out_bits, X_AXIS)) // stepping along -X axis (regular Cartesian bot)
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
{ // -direction
|
|
|
|
{ // -direction
|
|
|
|
#ifdef DUAL_X_CARRIAGE
|
|
|
|
#if ENABLED(DUAL_X_CARRIAGE)
|
|
|
|
// with 2 x-carriages, endstops are only checked in the homing direction for the active extruder
|
|
|
|
// with 2 x-carriages, endstops are only checked in the homing direction for the active extruder
|
|
|
|
if ((current_block->active_extruder == 0 && X_HOME_DIR == -1) || (current_block->active_extruder != 0 && X2_HOME_DIR == -1))
|
|
|
|
if ((current_block->active_extruder == 0 && X_HOME_DIR == -1) || (current_block->active_extruder != 0 && X2_HOME_DIR == -1))
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
@ -342,7 +342,7 @@ inline void update_endstops() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else { // +direction
|
|
|
|
else { // +direction
|
|
|
|
#ifdef DUAL_X_CARRIAGE
|
|
|
|
#if ENABLED(DUAL_X_CARRIAGE)
|
|
|
|
// with 2 x-carriages, endstops are only checked in the homing direction for the active extruder
|
|
|
|
// with 2 x-carriages, endstops are only checked in the homing direction for the active extruder
|
|
|
|
if ((current_block->active_extruder == 0 && X_HOME_DIR == 1) || (current_block->active_extruder != 0 && X2_HOME_DIR == 1))
|
|
|
|
if ((current_block->active_extruder == 0 && X_HOME_DIR == 1) || (current_block->active_extruder != 0 && X2_HOME_DIR == 1))
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
@ -352,11 +352,11 @@ inline void update_endstops() {
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#if defined(COREXY) || defined(COREXZ)
|
|
|
|
#if ENABLED(COREXY) || ENABLED(COREXZ)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef COREXY
|
|
|
|
#if ENABLED(COREXY)
|
|
|
|
// Head direction in -Y axis for CoreXY bots.
|
|
|
|
// Head direction in -Y axis for CoreXY bots.
|
|
|
|
// If DeltaX == DeltaY, the movement is only in X axis
|
|
|
|
// If DeltaX == DeltaY, the movement is only in X axis
|
|
|
|
if ((current_block->steps[A_AXIS] != current_block->steps[B_AXIS]) || (TEST(out_bits, A_AXIS) != TEST(out_bits, B_AXIS))) {
|
|
|
|
if ((current_block->steps[A_AXIS] != current_block->steps[B_AXIS]) || (TEST(out_bits, A_AXIS) != TEST(out_bits, B_AXIS))) {
|
|
|
@ -374,11 +374,11 @@ inline void update_endstops() {
|
|
|
|
UPDATE_ENDSTOP(Y, MAX);
|
|
|
|
UPDATE_ENDSTOP(Y, MAX);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#if defined(COREXY)
|
|
|
|
#if ENABLED(COREXY)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef COREXZ
|
|
|
|
#if ENABLED(COREXZ)
|
|
|
|
// Head direction in -Z axis for CoreXZ bots.
|
|
|
|
// Head direction in -Z axis for CoreXZ bots.
|
|
|
|
// If DeltaX == DeltaZ, the movement is only in X axis
|
|
|
|
// If DeltaX == DeltaZ, the movement is only in X axis
|
|
|
|
if ((current_block->steps[A_AXIS] != current_block->steps[C_AXIS]) || (TEST(out_bits, A_AXIS) != TEST(out_bits, C_AXIS))) {
|
|
|
|
if ((current_block->steps[A_AXIS] != current_block->steps[C_AXIS]) || (TEST(out_bits, A_AXIS) != TEST(out_bits, C_AXIS))) {
|
|
|
@ -389,7 +389,7 @@ inline void update_endstops() {
|
|
|
|
{ // z -direction
|
|
|
|
{ // z -direction
|
|
|
|
#if HAS_Z_MIN
|
|
|
|
#if HAS_Z_MIN
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef Z_DUAL_ENDSTOPS
|
|
|
|
#if ENABLED(Z_DUAL_ENDSTOPS)
|
|
|
|
SET_ENDSTOP_BIT(Z, MIN);
|
|
|
|
SET_ENDSTOP_BIT(Z, MIN);
|
|
|
|
#if HAS_Z2_MIN
|
|
|
|
#if HAS_Z2_MIN
|
|
|
|
SET_ENDSTOP_BIT(Z2, MIN);
|
|
|
|
SET_ENDSTOP_BIT(Z2, MIN);
|
|
|
@ -411,7 +411,7 @@ inline void update_endstops() {
|
|
|
|
#endif // !Z_DUAL_ENDSTOPS
|
|
|
|
#endif // !Z_DUAL_ENDSTOPS
|
|
|
|
#endif // Z_MIN_PIN
|
|
|
|
#endif // Z_MIN_PIN
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef Z_PROBE_ENDSTOP
|
|
|
|
#if ENABLED(Z_PROBE_ENDSTOP)
|
|
|
|
UPDATE_ENDSTOP(Z, PROBE);
|
|
|
|
UPDATE_ENDSTOP(Z, PROBE);
|
|
|
|
|
|
|
|
|
|
|
|
if (TEST_ENDSTOP(Z_PROBE))
|
|
|
|
if (TEST_ENDSTOP(Z_PROBE))
|
|
|
@ -424,7 +424,7 @@ inline void update_endstops() {
|
|
|
|
else { // z +direction
|
|
|
|
else { // z +direction
|
|
|
|
#if HAS_Z_MAX
|
|
|
|
#if HAS_Z_MAX
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef Z_DUAL_ENDSTOPS
|
|
|
|
#if ENABLED(Z_DUAL_ENDSTOPS)
|
|
|
|
|
|
|
|
|
|
|
|
SET_ENDSTOP_BIT(Z, MAX);
|
|
|
|
SET_ENDSTOP_BIT(Z, MAX);
|
|
|
|
#if HAS_Z2_MAX
|
|
|
|
#if HAS_Z2_MAX
|
|
|
@ -449,7 +449,7 @@ inline void update_endstops() {
|
|
|
|
#endif // !Z_DUAL_ENDSTOPS
|
|
|
|
#endif // !Z_DUAL_ENDSTOPS
|
|
|
|
#endif // Z_MAX_PIN
|
|
|
|
#endif // Z_MAX_PIN
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef Z_PROBE_ENDSTOP
|
|
|
|
#if ENABLED(Z_PROBE_ENDSTOP)
|
|
|
|
UPDATE_ENDSTOP(Z, PROBE);
|
|
|
|
UPDATE_ENDSTOP(Z, PROBE);
|
|
|
|
|
|
|
|
|
|
|
|
if (TEST_ENDSTOP(Z_PROBE))
|
|
|
|
if (TEST_ENDSTOP(Z_PROBE))
|
|
|
@ -459,7 +459,7 @@ inline void update_endstops() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#if defined(COREXZ)
|
|
|
|
#if ENABLED(COREXZ)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
old_endstop_bits = current_endstop_bits;
|
|
|
|
old_endstop_bits = current_endstop_bits;
|
|
|
|