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:
committed by
GitHub
parent
f5139f8bf4
commit
193c0a52d9
@ -305,27 +305,9 @@ namespace ExtUI {
|
||||
}
|
||||
|
||||
void setAxisPosition_mm(const float position, const axis_t axis, const feedRate_t feedrate/*=0*/) {
|
||||
// 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((AxisEnum)axis, min, max);
|
||||
|
||||
// Delta limits XY based on the current offset from center
|
||||
// This assumes the center is 0,0
|
||||
@ -389,8 +371,8 @@ namespace ExtUI {
|
||||
}
|
||||
|
||||
#if HAS_SOFTWARE_ENDSTOPS
|
||||
bool getSoftEndstopState() { return soft_endstops_enabled; }
|
||||
void setSoftEndstopState(const bool value) { soft_endstops_enabled = value; }
|
||||
bool getSoftEndstopState() { return soft_endstop._enabled; }
|
||||
void setSoftEndstopState(const bool value) { soft_endstop._enabled = value; }
|
||||
#endif
|
||||
|
||||
#if HAS_TRINAMIC_CONFIG
|
||||
|
Reference in New Issue
Block a user