Skip to content

Commit 2125039

Browse files
committed
use a flag
1 parent e6fb5b2 commit 2125039

File tree

3 files changed

+44
-30
lines changed

3 files changed

+44
-30
lines changed

Marlin/src/inc/Conditionals_LCD.h

-26
Original file line numberDiff line numberDiff line change
@@ -1068,32 +1068,6 @@
10681068
#ifndef Z_PROBE_SERVO_NR
10691069
#define Z_PROBE_SERVO_NR 0
10701070
#endif
1071-
#ifdef DEACTIVATE_SERVOS_AFTER_MOVE
1072-
#error "BLTOUCH requires DEACTIVATE_SERVOS_AFTER_MOVE to be to disabled. Please update your Configuration.h file."
1073-
#endif
1074-
1075-
// Always disable probe pin inverting for BLTouch
1076-
#if !MB(K8400)
1077-
#if Z_MIN_PROBE_ENDSTOP_INVERTING
1078-
#error "BLTOUCH requires Z_MIN_PROBE_ENDSTOP_INVERTING set to false. Please update your Configuration.h file."
1079-
#endif
1080-
#else // Special case for BOARD_K8400
1081-
#if !Z_MIN_PROBE_ENDSTOP_INVERTING
1082-
#error "BLTOUCH requires Z_MIN_PROBE_ENDSTOP_INVERTING set to true. Please update your Configuration.h file."
1083-
#endif
1084-
#endif
1085-
1086-
#if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
1087-
#if !MB(K8400)
1088-
#if Z_MIN_ENDSTOP_INVERTING
1089-
#error "BLTOUCH requires Z_MIN_ENDSTOP_INVERTING set to false. Please update your Configuration.h file."
1090-
#endif
1091-
#else // Special case for BOARD_K8400, Endstops are electronically inverted
1092-
#if !Z_MIN_ENDSTOP_INVERTING
1093-
#error "BLTOUCH requires Z_MIN_ENDSTOP_INVERTING set to true. Please update your Configuration.h file."
1094-
#endif
1095-
#endif
1096-
#endif
10971071
#endif
10981072

10991073
/**

Marlin/src/inc/SanityCheck.h

+40-4
Original file line numberDiff line numberDiff line change
@@ -1777,7 +1777,29 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
17771777
#if BLTOUCH_DELAY < 200
17781778
#error "BLTOUCH_DELAY less than 200 is unsafe and is not supported."
17791779
#endif
1780-
#endif
1780+
1781+
#ifdef DEACTIVATE_SERVOS_AFTER_MOVE
1782+
#error "BLTOUCH requires DEACTIVATE_SERVOS_AFTER_MOVE to be to disabled. Please update your Configuration.h file."
1783+
#endif
1784+
1785+
#if HAS_INVERTED_PROBE
1786+
#if !Z_MIN_PROBE_ENDSTOP_INVERTING
1787+
#error "BLTOUCH requires Z_MIN_PROBE_ENDSTOP_INVERTING set to true."
1788+
#endif
1789+
#elif Z_MIN_PROBE_ENDSTOP_INVERTING
1790+
#error "BLTOUCH requires Z_MIN_PROBE_ENDSTOP_INVERTING set to false."
1791+
#endif
1792+
#if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
1793+
#if HAS_INVERTED_PROBE
1794+
#if !Z_MIN_ENDSTOP_INVERTING
1795+
#error "BLTOUCH requires Z_MIN_ENDSTOP_INVERTING set to true."
1796+
#endif
1797+
#elif Z_MIN_ENDSTOP_INVERTING
1798+
#error "BLTOUCH requires Z_MIN_ENDSTOP_INVERTING set to false."
1799+
#endif
1800+
#endif
1801+
1802+
#endif // BLTOUCH
17811803

17821804
#if ENABLED(RACK_AND_PINION_PROBE) && !(defined(Z_PROBE_DEPLOY_X) && defined(Z_PROBE_RETRACT_X))
17831805
#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
17951817
#error "TOUCH_MI_PROBE requires Z_AFTER_PROBING to be disabled."
17961818
#elif Z_HOMING_HEIGHT < 10
17971819
#error "TOUCH_MI_PROBE requires Z_HOMING_HEIGHT >= 10."
1798-
#elif Z_MIN_PROBE_ENDSTOP_INVERTING
1799-
#error "TOUCH_MI_PROBE requires Z_MIN_PROBE_ENDSTOP_INVERTING to be set to false."
18001820
#elif DISABLED(BABYSTEP_ZPROBE_OFFSET)
18011821
#error "TOUCH_MI_PROBE requires BABYSTEPPING with BABYSTEP_ZPROBE_OFFSET."
18021822
#elif !HAS_RESUME_CONTINUE
18031823
#error "TOUCH_MI_PROBE currently requires an LCD controller or EMERGENCY_PARSER."
18041824
#endif
1805-
#endif
1825+
#if HAS_INVERTED_PROBE
1826+
#if !Z_MIN_PROBE_ENDSTOP_INVERTING
1827+
#error "TOUCH_MI_PROBE requires Z_MIN_PROBE_ENDSTOP_INVERTING set to true."
1828+
#endif
1829+
#elif Z_MIN_PROBE_ENDSTOP_INVERTING
1830+
#error "TOUCH_MI_PROBE requires Z_MIN_PROBE_ENDSTOP_INVERTING set to false."
1831+
#endif
1832+
#if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
1833+
#if HAS_INVERTED_PROBE
1834+
#if !Z_MIN_ENDSTOP_INVERTING
1835+
#error "TOUCH_MI_PROBE requires Z_MIN_ENDSTOP_INVERTING set to true."
1836+
#endif
1837+
#elif Z_MIN_ENDSTOP_INVERTING
1838+
#error "TOUCH_MI_PROBE requires Z_MIN_ENDSTOP_INVERTING set to false."
1839+
#endif
1840+
#endif
1841+
#endif // TOUCH_MI_PROBE
18061842

18071843
/**
18081844
* Mag mounted probe requirements

Marlin/src/pins/ramps/pins_K8400.h

+4
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@
5050
#define X_STOP_PIN 3
5151
#define Y_STOP_PIN 14
5252

53+
#if EITHER(BLTOUCH, TOUCH_MI_PROBE)
54+
#define HAS_INVERTED_PROBE
55+
#endif
56+
5357
#include "pins_3DRAG.h" // ... RAMPS
5458

5559
//

0 commit comments

Comments
 (0)