Merge pull request #6362 from tcm0116/babystepping

Only queue babysteps if axis is in a known position
This commit is contained in:
Scott Lahteine 2017-04-16 17:46:06 -05:00 committed by GitHub
commit bf2548be4a

View File

@ -431,31 +431,33 @@ class Temperature {
#if ENABLED(BABYSTEPPING) #if ENABLED(BABYSTEPPING)
static void babystep_axis(const AxisEnum axis, const int distance) { static void babystep_axis(const AxisEnum axis, const int distance) {
#if IS_CORE if (axis_known_position[axis]) {
#if ENABLED(BABYSTEP_XY) #if IS_CORE
switch (axis) { #if ENABLED(BABYSTEP_XY)
case CORE_AXIS_1: // X on CoreXY and CoreXZ, Y on CoreYZ switch (axis) {
babystepsTodo[CORE_AXIS_1] += distance * 2; case CORE_AXIS_1: // X on CoreXY and CoreXZ, Y on CoreYZ
babystepsTodo[CORE_AXIS_2] += distance * 2; babystepsTodo[CORE_AXIS_1] += distance * 2;
break; babystepsTodo[CORE_AXIS_2] += distance * 2;
case CORE_AXIS_2: // Y on CoreXY, Z on CoreXZ and CoreYZ break;
babystepsTodo[CORE_AXIS_1] += CORESIGN(distance * 2); case CORE_AXIS_2: // Y on CoreXY, Z on CoreXZ and CoreYZ
babystepsTodo[CORE_AXIS_2] -= CORESIGN(distance * 2); babystepsTodo[CORE_AXIS_1] += CORESIGN(distance * 2);
break; babystepsTodo[CORE_AXIS_2] -= CORESIGN(distance * 2);
case NORMAL_AXIS: // Z on CoreXY, Y on CoreXZ, X on CoreYZ break;
babystepsTodo[NORMAL_AXIS] += distance; case NORMAL_AXIS: // Z on CoreXY, Y on CoreXZ, X on CoreYZ
break; babystepsTodo[NORMAL_AXIS] += distance;
} break;
#elif CORE_IS_XZ || CORE_IS_YZ }
// Only Z stepping needs to be handled here #elif CORE_IS_XZ || CORE_IS_YZ
babystepsTodo[CORE_AXIS_1] += CORESIGN(distance * 2); // Only Z stepping needs to be handled here
babystepsTodo[CORE_AXIS_2] -= CORESIGN(distance * 2); babystepsTodo[CORE_AXIS_1] += CORESIGN(distance * 2);
babystepsTodo[CORE_AXIS_2] -= CORESIGN(distance * 2);
#else
babystepsTodo[Z_AXIS] += distance;
#endif
#else #else
babystepsTodo[Z_AXIS] += distance; babystepsTodo[axis] += distance;
#endif #endif
#else }
babystepsTodo[axis] += distance;
#endif
} }
#endif // BABYSTEPPING #endif // BABYSTEPPING