From e7247ebf69590af87a26d1cff52d4725b41e25cf Mon Sep 17 00:00:00 2001 From: ellensp <530024+ellensp@users.noreply.github.com> Date: Mon, 12 Dec 2022 19:35:02 +1300 Subject: [PATCH 1/3] add BOARD_K8400 BLTOUCH special case --- Marlin/src/inc/Conditionals_LCD.h | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index c1b43d2fc0c6..89f16cf55817 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -1073,13 +1073,25 @@ #endif // Always disable probe pin inverting for BLTouch - #if Z_MIN_PROBE_ENDSTOP_INVERTING - #error "BLTOUCH requires Z_MIN_PROBE_ENDSTOP_INVERTING set to false. Please update your Configuration.h file." + #if !MB(K8400) + #if Z_MIN_PROBE_ENDSTOP_INVERTING + #error "BLTOUCH requires Z_MIN_PROBE_ENDSTOP_INVERTING set to false. Please update your Configuration.h file." + #endif + #elif // Special case for BOARD_K8400 + #if !Z_MIN_PROBE_ENDSTOP_INVERTING + #error "BLTOUCH requires Z_MIN_PROBE_ENDSTOP_INVERTING set to true. Please update your Configuration.h file." + #endif #endif #if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) - #if Z_MIN_ENDSTOP_INVERTING - #error "BLTOUCH requires Z_MIN_ENDSTOP_INVERTING set to false. Please update your Configuration.h file." + #if !MB(K8400) + #if Z_MIN_ENDSTOP_INVERTING + #error "BLTOUCH requires Z_MIN_ENDSTOP_INVERTING set to false. Please update your Configuration.h file." + #endif + #else // Special case for BOARD_K8400, Endstops are electronically inverted + #if !Z_MIN_ENDSTOP_INVERTING + #error "BLTOUCH requires Z_MIN_ENDSTOP_INVERTING set to true. Please update your Configuration.h file." + #endif #endif #endif #endif From e6fb5b26242816f09ba67cf150ee41c44a83a006 Mon Sep 17 00:00:00 2001 From: ellensp <530024+ellensp@users.noreply.github.com> Date: Mon, 12 Dec 2022 19:57:35 +1300 Subject: [PATCH 2/3] fix typo --- Marlin/src/inc/Conditionals_LCD.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 89f16cf55817..0c4574edf876 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -1077,7 +1077,7 @@ #if Z_MIN_PROBE_ENDSTOP_INVERTING #error "BLTOUCH requires Z_MIN_PROBE_ENDSTOP_INVERTING set to false. Please update your Configuration.h file." #endif - #elif // Special case for BOARD_K8400 + #else // Special case for BOARD_K8400 #if !Z_MIN_PROBE_ENDSTOP_INVERTING #error "BLTOUCH requires Z_MIN_PROBE_ENDSTOP_INVERTING set to true. Please update your Configuration.h file." #endif From 2125039f221e04e4dfb142ef16e4d5855aedbf2f Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 12 Dec 2022 10:09:17 -0600 Subject: [PATCH 3/3] use a flag --- Marlin/src/inc/Conditionals_LCD.h | 26 ------------------ Marlin/src/inc/SanityCheck.h | 44 +++++++++++++++++++++++++++--- Marlin/src/pins/ramps/pins_K8400.h | 4 +++ 3 files changed, 44 insertions(+), 30 deletions(-) diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 0c4574edf876..def9ba445110 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -1068,32 +1068,6 @@ #ifndef Z_PROBE_SERVO_NR #define Z_PROBE_SERVO_NR 0 #endif - #ifdef DEACTIVATE_SERVOS_AFTER_MOVE - #error "BLTOUCH requires DEACTIVATE_SERVOS_AFTER_MOVE to be to disabled. Please update your Configuration.h file." - #endif - - // Always disable probe pin inverting for BLTouch - #if !MB(K8400) - #if Z_MIN_PROBE_ENDSTOP_INVERTING - #error "BLTOUCH requires Z_MIN_PROBE_ENDSTOP_INVERTING set to false. Please update your Configuration.h file." - #endif - #else // Special case for BOARD_K8400 - #if !Z_MIN_PROBE_ENDSTOP_INVERTING - #error "BLTOUCH requires Z_MIN_PROBE_ENDSTOP_INVERTING set to true. Please update your Configuration.h file." - #endif - #endif - - #if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) - #if !MB(K8400) - #if Z_MIN_ENDSTOP_INVERTING - #error "BLTOUCH requires Z_MIN_ENDSTOP_INVERTING set to false. Please update your Configuration.h file." - #endif - #else // Special case for BOARD_K8400, Endstops are electronically inverted - #if !Z_MIN_ENDSTOP_INVERTING - #error "BLTOUCH requires Z_MIN_ENDSTOP_INVERTING set to true. Please update your Configuration.h file." - #endif - #endif - #endif #endif /** diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index e8f390b5be20..79306c77a6ae 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -1777,7 +1777,29 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #if BLTOUCH_DELAY < 200 #error "BLTOUCH_DELAY less than 200 is unsafe and is not supported." #endif - #endif + + #ifdef DEACTIVATE_SERVOS_AFTER_MOVE + #error "BLTOUCH requires DEACTIVATE_SERVOS_AFTER_MOVE to be to disabled. Please update your Configuration.h file." + #endif + + #if HAS_INVERTED_PROBE + #if !Z_MIN_PROBE_ENDSTOP_INVERTING + #error "BLTOUCH requires Z_MIN_PROBE_ENDSTOP_INVERTING set to true." + #endif + #elif Z_MIN_PROBE_ENDSTOP_INVERTING + #error "BLTOUCH requires Z_MIN_PROBE_ENDSTOP_INVERTING set to false." + #endif + #if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) + #if HAS_INVERTED_PROBE + #if !Z_MIN_ENDSTOP_INVERTING + #error "BLTOUCH requires Z_MIN_ENDSTOP_INVERTING set to true." + #endif + #elif Z_MIN_ENDSTOP_INVERTING + #error "BLTOUCH requires Z_MIN_ENDSTOP_INVERTING set to false." + #endif + #endif + + #endif // BLTOUCH #if ENABLED(RACK_AND_PINION_PROBE) && !(defined(Z_PROBE_DEPLOY_X) && defined(Z_PROBE_RETRACT_X)) #error "RACK_AND_PINION_PROBE requires Z_PROBE_DEPLOY_X and Z_PROBE_RETRACT_X." @@ -1795,14 +1817,28 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "TOUCH_MI_PROBE requires Z_AFTER_PROBING to be disabled." #elif Z_HOMING_HEIGHT < 10 #error "TOUCH_MI_PROBE requires Z_HOMING_HEIGHT >= 10." - #elif Z_MIN_PROBE_ENDSTOP_INVERTING - #error "TOUCH_MI_PROBE requires Z_MIN_PROBE_ENDSTOP_INVERTING to be set to false." #elif DISABLED(BABYSTEP_ZPROBE_OFFSET) #error "TOUCH_MI_PROBE requires BABYSTEPPING with BABYSTEP_ZPROBE_OFFSET." #elif !HAS_RESUME_CONTINUE #error "TOUCH_MI_PROBE currently requires an LCD controller or EMERGENCY_PARSER." #endif - #endif + #if HAS_INVERTED_PROBE + #if !Z_MIN_PROBE_ENDSTOP_INVERTING + #error "TOUCH_MI_PROBE requires Z_MIN_PROBE_ENDSTOP_INVERTING set to true." + #endif + #elif Z_MIN_PROBE_ENDSTOP_INVERTING + #error "TOUCH_MI_PROBE requires Z_MIN_PROBE_ENDSTOP_INVERTING set to false." + #endif + #if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) + #if HAS_INVERTED_PROBE + #if !Z_MIN_ENDSTOP_INVERTING + #error "TOUCH_MI_PROBE requires Z_MIN_ENDSTOP_INVERTING set to true." + #endif + #elif Z_MIN_ENDSTOP_INVERTING + #error "TOUCH_MI_PROBE requires Z_MIN_ENDSTOP_INVERTING set to false." + #endif + #endif + #endif // TOUCH_MI_PROBE /** * Mag mounted probe requirements diff --git a/Marlin/src/pins/ramps/pins_K8400.h b/Marlin/src/pins/ramps/pins_K8400.h index 36c438aca2de..686c29b7fb8f 100644 --- a/Marlin/src/pins/ramps/pins_K8400.h +++ b/Marlin/src/pins/ramps/pins_K8400.h @@ -50,6 +50,10 @@ #define X_STOP_PIN 3 #define Y_STOP_PIN 14 +#if EITHER(BLTOUCH, TOUCH_MI_PROBE) + #define HAS_INVERTED_PROBE +#endif + #include "pins_3DRAG.h" // ... RAMPS //