@ -1541,19 +1541,25 @@ void get_arc_coordinates()
}
}
void prepare_move( )
void clamp_to_software_endstops(float target[3] )
{
if (min_software_endstops) {
if (des tin ation [X_AXIS] < X_MIN_POS) des tin ation [X_AXIS] = X_MIN_POS;
if (des tin ation [Y_AXIS] < Y_MIN_POS) des tin ation [Y_AXIS] = Y_MIN_POS;
if (des tin ation [Z_AXIS] < Z_MIN_POS) des tin ation [Z_AXIS] = Z_MIN_POS;
if (targe t[X_AXIS] < X_MIN_POS) targe t[X_AXIS] = X_MIN_POS;
if (targe t[Y_AXIS] < Y_MIN_POS) targe t[Y_AXIS] = Y_MIN_POS;
if (targe t[Z_AXIS] < Z_MIN_POS) targe t[Z_AXIS] = Z_MIN_POS;
}
if (max_software_endstops) {
if (des tin ation [X_AXIS] > X_MAX_POS) des tin ation [X_AXIS] = X_MAX_POS;
if (des tin ation [Y_AXIS] > Y_MAX_POS) des tin ation [Y_AXIS] = Y_MAX_POS;
if (des tin ation [Z_AXIS] > Z_MAX_POS) des tin ation [Z_AXIS] = Z_MAX_POS;
if (targe t[X_AXIS] > X_MAX_POS) targe t[X_AXIS] = X_MAX_POS;
if (targe t[Y_AXIS] > Y_MAX_POS) targe t[Y_AXIS] = Y_MAX_POS;
if (targe t[Z_AXIS] > Z_MAX_POS) targe t[Z_AXIS] = Z_MAX_POS;
}
}
void prepare_move()
{
clamp_to_software_endstops(destination);
previous_millis_cmd = millis();
plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate*feedmultiply/60/100.0, active_extruder);
for(int8_t i=0; i < NUM_AXIS; i++) {