Use bit flags for homed/known
This commit is contained in:
@@ -44,10 +44,10 @@ void manage_inactivity(const bool ignore_stepper_queue=false);
|
||||
|
||||
#if HAS_X2_ENABLE
|
||||
#define enable_X() do{ X_ENABLE_WRITE( X_ENABLE_ON); X2_ENABLE_WRITE( X_ENABLE_ON); }while(0)
|
||||
#define disable_X() do{ X_ENABLE_WRITE(!X_ENABLE_ON); X2_ENABLE_WRITE(!X_ENABLE_ON); axis_known_position[X_AXIS] = false; }while(0)
|
||||
#define disable_X() do{ X_ENABLE_WRITE(!X_ENABLE_ON); X2_ENABLE_WRITE(!X_ENABLE_ON); CBI(axis_known_position, X_AXIS); }while(0)
|
||||
#elif HAS_X_ENABLE
|
||||
#define enable_X() X_ENABLE_WRITE( X_ENABLE_ON)
|
||||
#define disable_X() do{ X_ENABLE_WRITE(!X_ENABLE_ON); axis_known_position[X_AXIS] = false; }while(0)
|
||||
#define disable_X() do{ X_ENABLE_WRITE(!X_ENABLE_ON); CBI(axis_known_position, X_AXIS); }while(0)
|
||||
#else
|
||||
#define enable_X() NOOP
|
||||
#define disable_X() NOOP
|
||||
@@ -55,10 +55,10 @@ void manage_inactivity(const bool ignore_stepper_queue=false);
|
||||
|
||||
#if HAS_Y2_ENABLE
|
||||
#define enable_Y() do{ Y_ENABLE_WRITE( Y_ENABLE_ON); Y2_ENABLE_WRITE(Y_ENABLE_ON); }while(0)
|
||||
#define disable_Y() do{ Y_ENABLE_WRITE(!Y_ENABLE_ON); Y2_ENABLE_WRITE(!Y_ENABLE_ON); axis_known_position[Y_AXIS] = false; }while(0)
|
||||
#define disable_Y() do{ Y_ENABLE_WRITE(!Y_ENABLE_ON); Y2_ENABLE_WRITE(!Y_ENABLE_ON); CBI(axis_known_position, Y_AXIS); }while(0)
|
||||
#elif HAS_Y_ENABLE
|
||||
#define enable_Y() Y_ENABLE_WRITE( Y_ENABLE_ON)
|
||||
#define disable_Y() do{ Y_ENABLE_WRITE(!Y_ENABLE_ON); axis_known_position[Y_AXIS] = false; }while(0)
|
||||
#define disable_Y() do{ Y_ENABLE_WRITE(!Y_ENABLE_ON); CBI(axis_known_position, Y_AXIS); }while(0)
|
||||
#else
|
||||
#define enable_Y() NOOP
|
||||
#define disable_Y() NOOP
|
||||
@@ -66,10 +66,10 @@ void manage_inactivity(const bool ignore_stepper_queue=false);
|
||||
|
||||
#if HAS_Z2_ENABLE
|
||||
#define enable_Z() do{ Z_ENABLE_WRITE( Z_ENABLE_ON); Z2_ENABLE_WRITE(Z_ENABLE_ON); }while(0)
|
||||
#define disable_Z() do{ Z_ENABLE_WRITE(!Z_ENABLE_ON); Z2_ENABLE_WRITE(!Z_ENABLE_ON); axis_known_position[Z_AXIS] = false; }while(0)
|
||||
#define disable_Z() do{ Z_ENABLE_WRITE(!Z_ENABLE_ON); Z2_ENABLE_WRITE(!Z_ENABLE_ON); CBI(axis_known_position, Z_AXIS); }while(0)
|
||||
#elif HAS_Z_ENABLE
|
||||
#define enable_Z() Z_ENABLE_WRITE( Z_ENABLE_ON)
|
||||
#define disable_Z() do{ Z_ENABLE_WRITE(!Z_ENABLE_ON); axis_known_position[Z_AXIS] = false; }while(0)
|
||||
#define disable_Z() do{ Z_ENABLE_WRITE(!Z_ENABLE_ON); CBI(axis_known_position, Z_AXIS); }while(0)
|
||||
#else
|
||||
#define enable_Z() NOOP
|
||||
#define disable_Z() NOOP
|
||||
@@ -169,8 +169,12 @@ extern bool Running;
|
||||
inline bool IsRunning() { return Running; }
|
||||
inline bool IsStopped() { return !Running; }
|
||||
|
||||
extern bool axis_known_position[XYZ];
|
||||
extern bool axis_homed[XYZ];
|
||||
extern uint8_t axis_homed, axis_known_position;
|
||||
|
||||
constexpr uint8_t xyz_bits = _BV(X_AXIS) | _BV(Y_AXIS) | _BV(Z_AXIS);
|
||||
FORCE_INLINE bool all_axes_homed() { return (axis_homed & xyz_bits) == xyz_bits; }
|
||||
FORCE_INLINE bool all_axes_known() { return (axis_known_position & xyz_bits) == xyz_bits; }
|
||||
|
||||
extern volatile bool wait_for_heatup;
|
||||
|
||||
#if HAS_RESUME_CONTINUE
|
||||
|
||||
Reference in New Issue
Block a user