|
@@ -1541,19 +1541,25 @@ void get_arc_coordinates()
|
1541
|
1541
|
}
|
1542
|
1542
|
}
|
1543
|
1543
|
|
1544
|
|
-void prepare_move()
|
|
1544
|
+void clamp_to_software_endstops(float target[3])
|
1545
|
1545
|
{
|
1546
|
1546
|
if (min_software_endstops) {
|
1547
|
|
- if (destination[X_AXIS] < X_MIN_POS) destination[X_AXIS] = X_MIN_POS;
|
1548
|
|
- if (destination[Y_AXIS] < Y_MIN_POS) destination[Y_AXIS] = Y_MIN_POS;
|
1549
|
|
- if (destination[Z_AXIS] < Z_MIN_POS) destination[Z_AXIS] = Z_MIN_POS;
|
|
1547
|
+ if (target[X_AXIS] < X_MIN_POS) target[X_AXIS] = X_MIN_POS;
|
|
1548
|
+ if (target[Y_AXIS] < Y_MIN_POS) target[Y_AXIS] = Y_MIN_POS;
|
|
1549
|
+ if (target[Z_AXIS] < Z_MIN_POS) target[Z_AXIS] = Z_MIN_POS;
|
1550
|
1550
|
}
|
1551
|
1551
|
|
1552
|
1552
|
if (max_software_endstops) {
|
1553
|
|
- if (destination[X_AXIS] > X_MAX_POS) destination[X_AXIS] = X_MAX_POS;
|
1554
|
|
- if (destination[Y_AXIS] > Y_MAX_POS) destination[Y_AXIS] = Y_MAX_POS;
|
1555
|
|
- if (destination[Z_AXIS] > Z_MAX_POS) destination[Z_AXIS] = Z_MAX_POS;
|
|
1553
|
+ if (target[X_AXIS] > X_MAX_POS) target[X_AXIS] = X_MAX_POS;
|
|
1554
|
+ if (target[Y_AXIS] > Y_MAX_POS) target[Y_AXIS] = Y_MAX_POS;
|
|
1555
|
+ if (target[Z_AXIS] > Z_MAX_POS) target[Z_AXIS] = Z_MAX_POS;
|
1556
|
1556
|
}
|
|
1557
|
+}
|
|
1558
|
+
|
|
1559
|
+void prepare_move()
|
|
1560
|
+{
|
|
1561
|
+ clamp_to_software_endstops(destination);
|
|
1562
|
+
|
1557
|
1563
|
previous_millis_cmd = millis();
|
1558
|
1564
|
plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate*feedmultiply/60/100.0, active_extruder);
|
1559
|
1565
|
for(int8_t i=0; i < NUM_AXIS; i++) {
|