if stepper axis_is_moving Z_AXIS if stepper motor_direction Z_AXIS_HEA

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
if (stepper.axis_is_moving(Z_AXIS)) {
if (stepper.motor_direction(Z_AXIS_HEAD)) { // Z -direction. Gantry down, bed up.
#if HAS_Z_MIN
#if ENABLED(Z_TRIPLE_ENDSTOPS)
PROCESS_TRIPLE_ENDSTOP(Z, Z2, Z3, MIN);
#if ENABLED(Z_DUAL_ENDSTOPS)
#if ENABLED(Z_MIN_PROBE_ENDSTOP)
if (!z_probe_enabled) PROCESS_DUAL_ENDSTOP(Z, Z2, MIN);;
#else
PROCESS_DUAL_ENDSTOP(Z, Z2, MIN);
#endif
#else
#if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
if (z_probe_enabled) PROCESS_ENDSTOP(Z, MIN);
#elif ENABLED(Z_MIN_PROBE_ENDSTOP)
if (!z_probe_enabled) PROCESS_ENDSTOP(Z, MIN);
#else
PROCESS_ENDSTOP(Z, MIN);
#endif
#endif
#endif
#endif