diff --git a/Marlin/stepper.cpp b/Marlin/stepper.cpp index bacf22406..a23b67a7c 100644 --- a/Marlin/stepper.cpp +++ b/Marlin/stepper.cpp @@ -162,14 +162,14 @@ volatile long Stepper::endstops_trigsteps[XYZ]; #if ENABLED(Z_DUAL_ENDSTOPS) #define Z_APPLY_STEP(v,Q) \ if (performing_homing) { \ - if (Z_HOME_DIR > 0) {\ - if (!(TEST(endstops.old_endstop_bits, Z_MAX) && (count_direction[Z_AXIS] > 0)) && !locked_z_motor) Z_STEP_WRITE(v); \ - if (!(TEST(endstops.old_endstop_bits, Z2_MAX) && (count_direction[Z_AXIS] > 0)) && !locked_z2_motor) Z2_STEP_WRITE(v); \ - } \ - else { \ + if (Z_HOME_DIR < 0) { \ if (!(TEST(endstops.old_endstop_bits, Z_MIN) && (count_direction[Z_AXIS] < 0)) && !locked_z_motor) Z_STEP_WRITE(v); \ if (!(TEST(endstops.old_endstop_bits, Z2_MIN) && (count_direction[Z_AXIS] < 0)) && !locked_z2_motor) Z2_STEP_WRITE(v); \ } \ + else { \ + if (!(TEST(endstops.old_endstop_bits, Z_MAX) && (count_direction[Z_AXIS] > 0)) && !locked_z_motor) Z_STEP_WRITE(v); \ + if (!(TEST(endstops.old_endstop_bits, Z2_MAX) && (count_direction[Z_AXIS] > 0)) && !locked_z2_motor) Z2_STEP_WRITE(v); \ + } \ } \ else { \ Z_STEP_WRITE(v); \