Add loose soft endstop state, apply to UBL fine-tune (#19681)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
This commit is contained in:
Earle F. Philhower, III
2020-10-12 14:48:04 -07:00
committed by GitHub
parent f5139f8bf4
commit 193c0a52d9
16 changed files with 106 additions and 133 deletions

View File

@ -813,27 +813,9 @@ static void moveAxis(AxisEnum axis, const int8_t direction) {
}
if (!ui.manual_move.processing) {
// Start with no limits to movement
float min = current_position[axis] - 1000,
max = current_position[axis] + 1000;
// Limit to software endstops, if enabled
#if HAS_SOFTWARE_ENDSTOPS
if (soft_endstops_enabled) switch (axis) {
case X_AXIS:
TERN_(MIN_SOFTWARE_ENDSTOP_X, min = soft_endstop.min.x);
TERN_(MAX_SOFTWARE_ENDSTOP_X, max = soft_endstop.max.x);
break;
case Y_AXIS:
TERN_(MIN_SOFTWARE_ENDSTOP_Y, min = soft_endstop.min.y);
TERN_(MAX_SOFTWARE_ENDSTOP_Y, max = soft_endstop.max.y);
break;
case Z_AXIS:
TERN_(MIN_SOFTWARE_ENDSTOP_Z, min = soft_endstop.min.z);
TERN_(MAX_SOFTWARE_ENDSTOP_Z, max = soft_endstop.max.z);
default: break;
}
#endif // HAS_SOFTWARE_ENDSTOPS
// Get motion limit from software endstops, if any
float min, max;
soft_endstop.get_manual_axis_limits(axis, min, max);
// Delta limits XY based on the current offset from center
// This assumes the center is 0,0