From ee302db6b42e3ae9e69c9a40227ce9e0297e4982 Mon Sep 17 00:00:00 2001 From: ellensp Date: Fri, 27 Nov 2020 17:50:21 +1300 Subject: [PATCH] Fix BTT GTR 1.0 endstop/DIAG pins (#20296) --- Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h | 51 ++++++++++++++++++--- 1 file changed, 45 insertions(+), 6 deletions(-) diff --git a/Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h b/Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h index 6c475faeb558..bfa4007658db 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h @@ -46,15 +46,54 @@ #define PS_ON_PIN PH6 +// +// Trinamic Stallguard pins +// +#define X_DIAG_PIN PF2 // X- +#define Y_DIAG_PIN PC13 // Y- +#define Z_DIAG_PIN PE0 // Z- +#define E0_DIAG_PIN PG14 // X+ +#define E1_DIAG_PIN PG9 // Y+ +#define E2_DIAG_PIN PD3 // Z+ + // // Limit Switches // -#define X_MIN_PIN PF2 -#define X_MAX_PIN PG14 -#define Y_MIN_PIN PC13 -#define Y_MAX_PIN PG9 -#define Z_MIN_PIN PE0 -#define Z_MAX_PIN PD3 +#ifdef X_STALL_SENSITIVITY + #define X_STOP_PIN X_DIAG_PIN + #if X_HOME_DIR < 0 + #define X_MAX_PIN E0_DIAG_PIN // X+ + #else + #define X_MIN_PIN E0_DIAG_PIN // X+ + #endif +#else + #define X_MIN_PIN X_DIAG_PIN // X- + #define X_MAX_PIN E0_DIAG_PIN // X+ +#endif + +#ifdef Y_STALL_SENSITIVITY + #define Y_STOP_PIN Y_DIAG_PIN + #if Y_HOME_DIR < 0 + #define Y_MAX_PIN E1_DIAG_PIN // Y+ + #else + #define Y_MIN_PIN E1_DIAG_PIN // Y+ + #endif +#else + #define Y_MIN_PIN Y_DIAG_PIN // Y- + #define Y_MAX_PIN E1_DIAG_PIN // Y+ +#endif + +#ifdef Z_STALL_SENSITIVITY + #define Z_STOP_PIN Z_DIAG_PIN + #if Z_HOME_DIR < 0 + #define Z_MAX_PIN E2_DIAG_PIN // Z+ + #else + #define Z_MIN_PIN E2_DIAG_PIN // Z+ + #endif +#else + #define Z_MIN_PIN Z_DIAG_PIN // Z- + #define Z_MAX_PIN E2_DIAG_PIN // Z+ +#endif // // Pins on the extender