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 #endif
#ifdef SCARA #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); for (int i = 0; i < 3; i++) homeposition[i] = base_home_pos(i);
// SERIAL_ECHOPGM("homeposition[x]= "); SERIAL_ECHO(homeposition[0]); // 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)); 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)); max_pos[axis] = base_max_pos(axis); // + (delta[axis] - base_home_pos(axis));
} }
else { else
current_position[axis] = base_home_pos(axis) + home_offset[axis]; #endif
min_pos[axis] = base_min_pos(axis) + home_offset[axis]; {
max_pos[axis] = base_max_pos(axis) + home_offset[axis];
}
#else
current_position[axis] = base_home_pos(axis) + home_offset[axis]; current_position[axis] = base_home_pos(axis) + home_offset[axis];
min_pos[axis] = base_min_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]; 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) { if (axis == X_AXIS ? HOMEAXIS_DO(X) : axis == Y_AXIS ? HOMEAXIS_DO(Y) : axis == Z_AXIS ? HOMEAXIS_DO(Z) : 0) {
int axis_home_dir; int axis_home_dir =
#ifdef DUAL_X_CARRIAGE
#ifdef DUAL_X_CARRIAGE (axis == X_AXIS) ? x_home_dir(active_extruder) :
if (axis == X_AXIS) axis_home_dir = x_home_dir(active_extruder); #endif
#else home_dir(axis);
axis_home_dir = home_dir(axis);
#endif
// Set the axis position as setup for the move // Set the axis position as setup for the move
current_position[axis] = 0; current_position[axis] = 0;