|
|
@ -67,65 +67,74 @@ volatile char Endstops::endstop_hit_bits; // use X_MIN, Y_MIN, Z_MIN and Z_MIN_P
|
|
|
|
void Endstops::init() {
|
|
|
|
void Endstops::init() {
|
|
|
|
|
|
|
|
|
|
|
|
#if HAS_X_MIN
|
|
|
|
#if HAS_X_MIN
|
|
|
|
SET_INPUT(X_MIN_PIN);
|
|
|
|
|
|
|
|
#if ENABLED(ENDSTOPPULLUP_XMIN)
|
|
|
|
#if ENABLED(ENDSTOPPULLUP_XMIN)
|
|
|
|
WRITE(X_MIN_PIN,HIGH);
|
|
|
|
SET_INPUT_PULLUP(X_MIN_PIN);
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
SET_INPUT(X_MIN_PIN);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#if HAS_Y_MIN
|
|
|
|
#if HAS_Y_MIN
|
|
|
|
SET_INPUT(Y_MIN_PIN);
|
|
|
|
|
|
|
|
#if ENABLED(ENDSTOPPULLUP_YMIN)
|
|
|
|
#if ENABLED(ENDSTOPPULLUP_YMIN)
|
|
|
|
WRITE(Y_MIN_PIN,HIGH);
|
|
|
|
SET_INPUT_PULLUP(Y_MIN_PIN);
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
SET_INPUT(Y_MIN_PIN);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#if HAS_Z_MIN
|
|
|
|
#if HAS_Z_MIN
|
|
|
|
SET_INPUT(Z_MIN_PIN);
|
|
|
|
|
|
|
|
#if ENABLED(ENDSTOPPULLUP_ZMIN)
|
|
|
|
#if ENABLED(ENDSTOPPULLUP_ZMIN)
|
|
|
|
WRITE(Z_MIN_PIN,HIGH);
|
|
|
|
SET_INPUT_PULLUP(Z_MIN_PIN);
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
SET_INPUT(Z_MIN_PIN);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#if HAS_Z2_MIN
|
|
|
|
#if HAS_Z2_MIN
|
|
|
|
SET_INPUT(Z2_MIN_PIN);
|
|
|
|
|
|
|
|
#if ENABLED(ENDSTOPPULLUP_ZMIN)
|
|
|
|
#if ENABLED(ENDSTOPPULLUP_ZMIN)
|
|
|
|
WRITE(Z2_MIN_PIN,HIGH);
|
|
|
|
SET_INPUT_PULLUP(Z2_MIN_PIN);
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
SET_INPUT(Z2_MIN_PIN);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#if HAS_X_MAX
|
|
|
|
#if HAS_X_MAX
|
|
|
|
SET_INPUT(X_MAX_PIN);
|
|
|
|
|
|
|
|
#if ENABLED(ENDSTOPPULLUP_XMAX)
|
|
|
|
#if ENABLED(ENDSTOPPULLUP_XMAX)
|
|
|
|
WRITE(X_MAX_PIN,HIGH);
|
|
|
|
SET_INPUT_PULLUP(X_MAX_PIN);
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
SET_INPUT(X_MAX_PIN);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#if HAS_Y_MAX
|
|
|
|
#if HAS_Y_MAX
|
|
|
|
SET_INPUT(Y_MAX_PIN);
|
|
|
|
|
|
|
|
#if ENABLED(ENDSTOPPULLUP_YMAX)
|
|
|
|
#if ENABLED(ENDSTOPPULLUP_YMAX)
|
|
|
|
WRITE(Y_MAX_PIN,HIGH);
|
|
|
|
SET_INPUT_PULLUP(Y_MAX_PIN);
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
SET_INPUT(Y_MAX_PIN);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#if HAS_Z_MAX
|
|
|
|
#if HAS_Z_MAX
|
|
|
|
SET_INPUT(Z_MAX_PIN);
|
|
|
|
|
|
|
|
#if ENABLED(ENDSTOPPULLUP_ZMAX)
|
|
|
|
#if ENABLED(ENDSTOPPULLUP_ZMAX)
|
|
|
|
WRITE(Z_MAX_PIN,HIGH);
|
|
|
|
SET_INPUT_PULLUP(Z_MAX_PIN);
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
SET_INPUT(Z_MAX_PIN);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#if HAS_Z2_MAX
|
|
|
|
#if HAS_Z2_MAX
|
|
|
|
SET_INPUT(Z2_MAX_PIN);
|
|
|
|
|
|
|
|
#if ENABLED(ENDSTOPPULLUP_ZMAX)
|
|
|
|
#if ENABLED(ENDSTOPPULLUP_ZMAX)
|
|
|
|
WRITE(Z2_MAX_PIN,HIGH);
|
|
|
|
SET_INPUT_PULLUP(Z2_MAX_PIN);
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
SET_INPUT(Z2_MAX_PIN);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(Z_MIN_PROBE_ENDSTOP)
|
|
|
|
#if ENABLED(Z_MIN_PROBE_ENDSTOP)
|
|
|
|
SET_INPUT(Z_MIN_PROBE_PIN);
|
|
|
|
|
|
|
|
#if ENABLED(ENDSTOPPULLUP_ZMIN_PROBE)
|
|
|
|
#if ENABLED(ENDSTOPPULLUP_ZMIN_PROBE)
|
|
|
|
WRITE(Z_MIN_PROBE_PIN,HIGH);
|
|
|
|
SET_INPUT_PULLUP(Z_MIN_PROBE_PIN);
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
SET_INPUT(Z_MIN_PROBE_PIN);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|