Skip to content

Commit

Permalink
🔧 Use multi-XYZ 'STOP' pins for MIN/MAX (MarlinFirmware#24855)
Browse files Browse the repository at this point in the history
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
  • Loading branch information
ils15 and thinkyhead committed Dec 18, 2022
1 parent cbb56e3 commit 5198a55
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions Marlin/src/inc/Conditionals_post.h
Original file line number Diff line number Diff line change
Expand Up @@ -930,6 +930,12 @@
#define X2_MAX_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING
#endif
#endif
#if !PIN_EXISTS(X2_MAX)
#undef X2_MAX_PIN
#if PIN_EXISTS(X2_STOP)
#define X2_MAX_PIN X2_STOP_PIN
#endif
#endif
#else
#ifndef X2_MIN_ENDSTOP_INVERTING
#if X2_USE_ENDSTOP == _XMIN_
Expand All @@ -946,6 +952,12 @@
#define X2_MIN_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING
#endif
#endif
#if !PIN_EXISTS(X2_MIN)
#undef X2_MIN_PIN
#if PIN_EXISTS(X2_STOP)
#define X2_MIN_PIN X2_STOP_PIN
#endif
#endif
#endif
#ifndef X2_MAX_ENDSTOP_INVERTING
#define X2_MAX_ENDSTOP_INVERTING false
Expand Down Expand Up @@ -975,6 +987,12 @@
#define Y2_MAX_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING
#endif
#endif
#if !PIN_EXISTS(Y2_MAX)
#undef Y2_MAX_PIN
#if PIN_EXISTS(Y2_STOP)
#define Y2_MAX_PIN Y2_STOP_PIN
#endif
#endif
#else
#ifndef Y2_MIN_ENDSTOP_INVERTING
#if Y2_USE_ENDSTOP == _XMIN_
Expand All @@ -991,6 +1009,12 @@
#define Y2_MIN_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING
#endif
#endif
#if !PIN_EXISTS(Y2_MIN)
#undef Y2_MIN_PIN
#if PIN_EXISTS(Y2_STOP)
#define Y2_MIN_PIN Y2_STOP_PIN
#endif
#endif
#endif
#ifndef Y2_MAX_ENDSTOP_INVERTING
#define Y2_MAX_ENDSTOP_INVERTING false
Expand Down Expand Up @@ -1021,6 +1045,12 @@
#define Z2_MAX_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING
#endif
#endif
#if !PIN_EXISTS(Z2_MAX)
#undef Z2_MAX_PIN
#if PIN_EXISTS(Z2_STOP)
#define Z2_MAX_PIN Z2_STOP_PIN
#endif
#endif
#else
#ifndef Z2_MIN_ENDSTOP_INVERTING
#if Z2_USE_ENDSTOP == _XMIN_
Expand All @@ -1037,6 +1067,12 @@
#define Z2_MIN_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING
#endif
#endif
#if !PIN_EXISTS(Z2_MIN)
#undef Z2_MIN_PIN
#if PIN_EXISTS(Z2_STOP)
#define Z2_MIN_PIN Z2_STOP_PIN
#endif
#endif
#endif
#ifndef Z2_MAX_ENDSTOP_INVERTING
#define Z2_MAX_ENDSTOP_INVERTING false
Expand All @@ -1062,6 +1098,12 @@
#define Z3_MAX_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING
#endif
#endif
#if !PIN_EXISTS(Z3_MAX)
#undef Z3_MAX_PIN
#if PIN_EXISTS(Z3_STOP)
#define Z3_MAX_PIN Z3_STOP_PIN
#endif
#endif
#else
#ifndef Z3_MIN_ENDSTOP_INVERTING
#if Z3_USE_ENDSTOP == _XMIN_
Expand All @@ -1078,6 +1120,12 @@
#define Z3_MIN_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING
#endif
#endif
#if !PIN_EXISTS(Z3_MIN)
#undef Z3_MIN_PIN
#if PIN_EXISTS(Z3_STOP)
#define Z3_MIN_PIN Z3_STOP_PIN
#endif
#endif
#endif
#ifndef Z3_MAX_ENDSTOP_INVERTING
#define Z3_MAX_ENDSTOP_INVERTING false
Expand All @@ -1104,6 +1152,12 @@
#define Z4_MAX_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING
#endif
#endif
#if !PIN_EXISTS(Z4_MAX)
#undef Z4_MAX_PIN
#if PIN_EXISTS(Z4_STOP)
#define Z4_MAX_PIN Z4_STOP_PIN
#endif
#endif
#else
#ifndef Z4_MIN_ENDSTOP_INVERTING
#if Z4_USE_ENDSTOP == _XMIN_
Expand All @@ -1120,6 +1174,12 @@
#define Z4_MIN_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING
#endif
#endif
#if !PIN_EXISTS(Z4_MIN)
#undef Z4_MIN_PIN
#if PIN_EXISTS(Z4_STOP)
#define Z4_MIN_PIN Z4_STOP_PIN
#endif
#endif
#endif
#ifndef Z4_MAX_ENDSTOP_INVERTING
#define Z4_MAX_ENDSTOP_INVERTING false
Expand Down

0 comments on commit 5198a55

Please sign in to comment.