Implement support for Dual X and Y endstops

This commit is contained in:
Scott Lahteine 2017-10-27 16:24:34 -05:00
parent 7e1232269a
commit 318c419f77
14 changed files with 718 additions and 268 deletions

View file

@ -87,7 +87,7 @@ class Stepper {
static bool abort_on_endstop_hit;
#endif
#if ENABLED(Z_DUAL_ENDSTOPS)
#if ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS)
static bool performing_homing;
#endif
@ -103,6 +103,12 @@ class Stepper {
static uint8_t last_direction_bits; // The next stepping-bits to be output
static uint16_t cleaning_buffer_counter;
#if ENABLED(X_DUAL_ENDSTOPS)
static bool locked_x_motor, locked_x2_motor;
#endif
#if ENABLED(Y_DUAL_ENDSTOPS)
static bool locked_y_motor, locked_y2_motor;
#endif
#if ENABLED(Z_DUAL_ENDSTOPS)
static bool locked_z_motor, locked_z2_motor;
#endif
@ -250,8 +256,18 @@ class Stepper {
static void microstep_readings();
#endif
#if ENABLED(X_DUAL_ENDSTOPS)
static FORCE_INLINE void set_homing_flag_x(const bool state) { performing_homing = state; }
static FORCE_INLINE void set_x_lock(const bool state) { locked_x_motor = state; }
static FORCE_INLINE void set_x2_lock(const bool state) { locked_x2_motor = state; }
#endif
#if ENABLED(Y_DUAL_ENDSTOPS)
static FORCE_INLINE void set_homing_flag_y(const bool state) { performing_homing = state; }
static FORCE_INLINE void set_y_lock(const bool state) { locked_y_motor = state; }
static FORCE_INLINE void set_y2_lock(const bool state) { locked_y2_motor = state; }
#endif
#if ENABLED(Z_DUAL_ENDSTOPS)
static FORCE_INLINE void set_homing_flag(const bool state) { performing_homing = state; }
static FORCE_INLINE void set_homing_flag_z(const bool state) { performing_homing = state; }
static FORCE_INLINE void set_z_lock(const bool state) { locked_z_motor = state; }
static FORCE_INLINE void set_z2_lock(const bool state) { locked_z2_motor = state; }
#endif