Merge pull request #1958 from thinkyhead/redo_1937

Fix homing of YZ with DUAL_X_CARRIAGE
This commit is contained in:
Scott Lahteine 2015-04-23 19:12:51 -07:00
commit c2e11daf66

View File

@ -990,10 +990,10 @@ static void axis_is_at_home(int axis) {
#endif
#ifdef SCARA
float homeposition[3];
if (axis < 2) {
if (axis == X_AXIS || axis == Y_AXIS) {
float homeposition[3];
for (int i = 0; i < 3; i++) homeposition[i] = base_home_pos(i);
// SERIAL_ECHOPGM("homeposition[x]= "); SERIAL_ECHO(homeposition[0]);
@ -1024,16 +1024,13 @@ static void axis_is_at_home(int axis) {
min_pos[axis] = base_min_pos(axis); // + (delta[axis] - base_home_pos(axis));
max_pos[axis] = base_max_pos(axis); // + (delta[axis] - base_home_pos(axis));
}
else {
current_position[axis] = base_home_pos(axis) + home_offset[axis];
min_pos[axis] = base_min_pos(axis) + home_offset[axis];
max_pos[axis] = base_max_pos(axis) + home_offset[axis];
}
#else
else
#endif
{
current_position[axis] = base_home_pos(axis) + home_offset[axis];
min_pos[axis] = base_min_pos(axis) + home_offset[axis];
max_pos[axis] = base_max_pos(axis) + home_offset[axis];
#endif
}
}
/**
@ -1501,13 +1498,11 @@ static void homeaxis(AxisEnum axis) {
if (axis == X_AXIS ? HOMEAXIS_DO(X) : axis == Y_AXIS ? HOMEAXIS_DO(Y) : axis == Z_AXIS ? HOMEAXIS_DO(Z) : 0) {
int axis_home_dir;
#ifdef DUAL_X_CARRIAGE
if (axis == X_AXIS) axis_home_dir = x_home_dir(active_extruder);
#else
axis_home_dir = home_dir(axis);
#endif
int axis_home_dir =
#ifdef DUAL_X_CARRIAGE
(axis == X_AXIS) ? x_home_dir(active_extruder) :
#endif
home_dir(axis);
// Set the axis position as setup for the move
current_position[axis] = 0;