|
@ -456,29 +456,28 @@ float soft_endstop_min[XYZ] = { X_MIN_BED, Y_MIN_BED, Z_MIN_POS }, |
|
|
|
|
|
|
|
|
/**
|
|
|
/**
|
|
|
* Constrain the given coordinates to the software endstops. |
|
|
* Constrain the given coordinates to the software endstops. |
|
|
|
|
|
* |
|
|
|
|
|
* NOTE: This will only apply to Z on DELTA and SCARA. XY is |
|
|
|
|
|
* constrained to a circle on these kinematic systems. |
|
|
*/ |
|
|
*/ |
|
|
|
|
|
|
|
|
// NOTE: This makes no sense for delta beds other than Z-axis.
|
|
|
|
|
|
// For delta the X/Y would need to be clamped at
|
|
|
|
|
|
// DELTA_PRINTABLE_RADIUS from center of bed, but delta
|
|
|
|
|
|
// now enforces is_position_reachable for X/Y regardless
|
|
|
|
|
|
// of HAS_SOFTWARE_ENDSTOPS, so that enforcement would be
|
|
|
|
|
|
// redundant here.
|
|
|
|
|
|
|
|
|
|
|
|
void clamp_to_software_endstops(float target[XYZ]) { |
|
|
void clamp_to_software_endstops(float target[XYZ]) { |
|
|
if (!soft_endstops_enabled) return; |
|
|
if (!soft_endstops_enabled) return; |
|
|
#if ENABLED(MIN_SOFTWARE_ENDSTOPS) |
|
|
#if ENABLED(MIN_SOFTWARE_ENDSTOP_X) |
|
|
#if DISABLED(DELTA) |
|
|
|
|
|
NOLESS(target[X_AXIS], soft_endstop_min[X_AXIS]); |
|
|
NOLESS(target[X_AXIS], soft_endstop_min[X_AXIS]); |
|
|
|
|
|
#endif |
|
|
|
|
|
#if ENABLED(MIN_SOFTWARE_ENDSTOP_Y) |
|
|
NOLESS(target[Y_AXIS], soft_endstop_min[Y_AXIS]); |
|
|
NOLESS(target[Y_AXIS], soft_endstop_min[Y_AXIS]); |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
#if ENABLED(MIN_SOFTWARE_ENDSTOP_Z) |
|
|
NOLESS(target[Z_AXIS], soft_endstop_min[Z_AXIS]); |
|
|
NOLESS(target[Z_AXIS], soft_endstop_min[Z_AXIS]); |
|
|
#endif |
|
|
#endif |
|
|
#if ENABLED(MAX_SOFTWARE_ENDSTOPS) |
|
|
#if ENABLED(MAX_SOFTWARE_ENDSTOP_X) |
|
|
#if DISABLED(DELTA) |
|
|
|
|
|
NOMORE(target[X_AXIS], soft_endstop_max[X_AXIS]); |
|
|
NOMORE(target[X_AXIS], soft_endstop_max[X_AXIS]); |
|
|
|
|
|
#endif |
|
|
|
|
|
#if ENABLED(MAX_SOFTWARE_ENDSTOP_Y) |
|
|
NOMORE(target[Y_AXIS], soft_endstop_max[Y_AXIS]); |
|
|
NOMORE(target[Y_AXIS], soft_endstop_max[Y_AXIS]); |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
#if ENABLED(MAX_SOFTWARE_ENDSTOP_Z) |
|
|
NOMORE(target[Z_AXIS], soft_endstop_max[Z_AXIS]); |
|
|
NOMORE(target[Z_AXIS], soft_endstop_max[Z_AXIS]); |
|
|
#endif |
|
|
#endif |
|
|
} |
|
|
} |
|
|