Implement support for Dual X and Y endstops

This commit is contained in:
Scott Lahteine
2017-10-29 03:43:44 -05:00
parent 7465ede058
commit 723f2a77f6
13 changed files with 736 additions and 239 deletions

View File

@ -66,7 +66,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
@ -82,6 +82,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
@ -227,8 +233,20 @@ 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