diff --git a/Marlin/stepper.cpp b/Marlin/stepper.cpp index 39414c2ad..458e9d792 100644 --- a/Marlin/stepper.cpp +++ b/Marlin/stepper.cpp @@ -1325,16 +1325,16 @@ void Stepper::report_positions() { #endif #endif - #define BABYSTEP_AXIS(AXIS, INVERT) { \ - const uint8_t old_dir = _READ_DIR(AXIS); \ - _ENABLE(AXIS); \ - _SAVE_START; \ - _APPLY_DIR(AXIS, _INVERT_DIR(AXIS)^direction^INVERT); \ - _PULSE_WAIT; \ - _APPLY_STEP(AXIS)(!_INVERT_STEP_PIN(AXIS), true); \ - _PULSE_WAIT; \ - _APPLY_STEP(AXIS)(_INVERT_STEP_PIN(AXIS), true); \ - _APPLY_DIR(AXIS, old_dir); \ + #define BABYSTEP_AXIS(AXIS, INVERT, DIR) { \ + const uint8_t old_dir = _READ_DIR(AXIS); \ + _ENABLE(AXIS); \ + _SAVE_START; \ + _APPLY_DIR(AXIS, _INVERT_DIR(AXIS)^DIR^INVERT); \ + _PULSE_WAIT; \ + _APPLY_STEP(AXIS)(!_INVERT_STEP_PIN(AXIS), true); \ + _PULSE_WAIT; \ + _APPLY_STEP(AXIS)(_INVERT_STEP_PIN(AXIS), true); \ + _APPLY_DIR(AXIS, old_dir); \ } // MUST ONLY BE CALLED BY AN ISR, @@ -1347,20 +1347,43 @@ void Stepper::report_positions() { #if ENABLED(BABYSTEP_XY) case X_AXIS: - BABYSTEP_AXIS(X, false); + #if CORE_IS_XY + BABYSTEP_AXIS(X, false, direction); + BABYSTEP_AXIS(Y, false, direction); + #elif CORE_IS_XZ + BABYSTEP_AXIS(X, false, direction); + BABYSTEP_AXIS(Z, false, direction); + #else + BABYSTEP_AXIS(X, false, direction); + #endif break; case Y_AXIS: - BABYSTEP_AXIS(Y, false); + #if CORE_IS_XY + BABYSTEP_AXIS(X, false, direction); + BABYSTEP_AXIS(Y, false, direction^(CORESIGN(1)<0)); + #elif CORE_IS_YZ + BABYSTEP_AXIS(Y, false, direction); + BABYSTEP_AXIS(Z, false, direction^(CORESIGN(1)<0)); + #else + BABYSTEP_AXIS(Y, false, direction); + #endif break; #endif case Z_AXIS: { - #if DISABLED(DELTA) + #if CORE_IS_XZ + BABYSTEP_AXIS(X, BABYSTEP_INVERT_Z, direction); + BABYSTEP_AXIS(Z, BABYSTEP_INVERT_Z, direction^(CORESIGN(1)<0)); - BABYSTEP_AXIS(Z, BABYSTEP_INVERT_Z); + #elif CORE_IS_YZ + BABYSTEP_AXIS(Y, BABYSTEP_INVERT_Z, direction); + BABYSTEP_AXIS(Z, BABYSTEP_INVERT_Z, direction^(CORESIGN(1)<0)); + + #elif DISABLED(DELTA) + BABYSTEP_AXIS(Z, BABYSTEP_INVERT_Z, direction); #else // DELTA