|
@@ -19,6 +19,7 @@
|
19
|
19
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
20
|
20
|
*
|
21
|
21
|
*/
|
|
22
|
+#pragma once
|
22
|
23
|
|
23
|
24
|
/**
|
24
|
25
|
* SanityCheck.h
|
|
@@ -26,9 +27,6 @@
|
26
|
27
|
* Test configuration values for errors at compile-time.
|
27
|
28
|
*/
|
28
|
29
|
|
29
|
|
-#ifndef _SANITYCHECK_H_
|
30
|
|
-#define _SANITYCHECK_H_
|
31
|
|
-
|
32
|
30
|
/**
|
33
|
31
|
* Require gcc 4.7 or newer (first included with Arduino 1.6.8) for C++11 features.
|
34
|
32
|
*/
|
|
@@ -1707,31 +1705,62 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE && Y_MAX_LENGTH >= Y_BED_SIZE,
|
1707
|
1705
|
* Check existing CS pins against enabled TMC SPI drivers.
|
1708
|
1706
|
*/
|
1709
|
1707
|
#if AXIS_DRIVER_TYPE(X, TMC2130) && !PIN_EXISTS(X_CS)
|
1710
|
|
- #error "X_CS_PIN is required for TMC2130. Define X_CS_PIN in Configuration_adv.h."
|
|
1708
|
+ #error "TMC2130 on X requires X_CS_PIN."
|
1711
|
1709
|
#elif AXIS_DRIVER_TYPE(X2, TMC2130) && !PIN_EXISTS(X2_CS)
|
1712
|
|
- #error "X2_CS_PIN is required for X2. Define X2_CS_PIN in Configuration_adv.h."
|
|
1710
|
+ #error "TMC2130 on X2 requires X2_CS_PIN."
|
1713
|
1711
|
#elif AXIS_DRIVER_TYPE(Y, TMC2130) && !PIN_EXISTS(Y_CS)
|
1714
|
|
- #error "Y_CS_PIN is required for TMC2130. Define Y_CS_PIN in Configuration_adv.h."
|
|
1712
|
+ #error "TMC2130 on Y requires Y_CS_PIN."
|
1715
|
1713
|
#elif AXIS_DRIVER_TYPE(Y2, TMC2130) && !PIN_EXISTS(Y2_CS)
|
1716
|
|
- #error "Y2_CS_PIN is required for TMC2130. Define Y2_CS_PIN in Configuration_adv.h."
|
|
1714
|
+ #error "TMC2130 on Y2 requires Y2_CS_PIN."
|
1717
|
1715
|
#elif AXIS_DRIVER_TYPE(Z, TMC2130) && !PIN_EXISTS(Z_CS)
|
1718
|
|
- #error "Z_CS_PIN is required for TMC2130. Define Z_CS_PIN in Configuration_adv.h."
|
|
1716
|
+ #error "TMC2130 on Z requires Z_CS_PIN."
|
1719
|
1717
|
#elif AXIS_DRIVER_TYPE(Z2, TMC2130) && !PIN_EXISTS(Z2_CS)
|
1720
|
|
- #error "Z2_CS_PIN is required for TMC2130. Define Z2_CS_PIN in Configuration_adv.h."
|
|
1718
|
+ #error "TMC2130 on Z2 requires Z2_CS_PIN."
|
1721
|
1719
|
#elif AXIS_DRIVER_TYPE(Z3, TMC2130) && !PIN_EXISTS(Z3_CS)
|
1722
|
|
- #error "Z3_CS_PIN is required for TMC2130. Define Z3_CS_PIN in Configuration_adv.h."
|
|
1720
|
+ #error "TMC2130 on Z3 requires Z3_CS_PIN."
|
1723
|
1721
|
#elif AXIS_DRIVER_TYPE(E0, TMC2130) && !PIN_EXISTS(E0_CS)
|
1724
|
|
- #error "E0_CS_PIN is required for TMC2130. Define E0_CS_PIN in Configuration_adv.h."
|
|
1722
|
+ #error "TMC2130 on E0 requires E0_CS_PIN."
|
1725
|
1723
|
#elif AXIS_DRIVER_TYPE(E1, TMC2130) && !PIN_EXISTS(E1_CS)
|
1726
|
|
- #error "E1_CS_PIN is required for TMC2130. Define E1_CS_PIN in Configuration_adv.h."
|
|
1724
|
+ #error "TMC2130 on E1 requires E1_CS_PIN."
|
1727
|
1725
|
#elif AXIS_DRIVER_TYPE(E2, TMC2130) && !PIN_EXISTS(E2_CS)
|
1728
|
|
- #error "E2_CS_PIN is required for TMC2130. Define E2_CS_PIN in Configuration_adv.h."
|
|
1726
|
+ #error "TMC2130 on E2 requires E2_CS_PIN."
|
1729
|
1727
|
#elif AXIS_DRIVER_TYPE(E3, TMC2130) && !PIN_EXISTS(E3_CS)
|
1730
|
|
- #error "E3_CS_PIN is required for TMC2130. Define E3_CS_PIN in Configuration_adv.h."
|
|
1728
|
+ #error "TMC2130 on E3 requires E3_CS_PIN."
|
1731
|
1729
|
#elif AXIS_DRIVER_TYPE(E4, TMC2130) && !PIN_EXISTS(E4_CS)
|
1732
|
|
- #error "E4_CS_PIN is required for TMC2130. Define E4_CS_PIN in Configuration_adv.h."
|
|
1730
|
+ #error "TMC2130 on E4 requires E4_CS_PIN."
|
1733
|
1731
|
#elif AXIS_DRIVER_TYPE(E5, TMC2130) && !PIN_EXISTS(E5_CS)
|
1734
|
|
- #error "E5_CS_PIN is required for TMC2130. Define E5_CS_PIN in Configuration_adv.h."
|
|
1732
|
+ #error "TMC2130 on E5 requires E5_CS_PIN."
|
|
1733
|
+#endif
|
|
1734
|
+
|
|
1735
|
+/**
|
|
1736
|
+ * Check existing RX/TX pins against enable TMC UART drivers.
|
|
1737
|
+ */
|
|
1738
|
+#if AXIS_DRIVER_TYPE(X, TMC2208) && !(defined(X_HARDWARE_SERIAL) || (PIN_EXISTS(X_SERIAL_RX) && PIN_EXISTS(X_SERIAL_TX)))
|
|
1739
|
+ #error "TMC2208 on X requires X_HARDWARE_SERIAL or both X_SERIAL_RX_PIN and X_SERIAL_TX_PIN."
|
|
1740
|
+#elif AXIS_DRIVER_TYPE(X2, TMC2208) && !(defined(X2_HARDWARE_SERIAL) || (PIN_EXISTS(X2_SERIAL_RX) && PIN_EXISTS(X2_SERIAL_TX)))
|
|
1741
|
+ #error "TMC2208 on X2 requires X2_HARDWARE_SERIAL or both X2_SERIAL_RX_PIN and X2_SERIAL_TX_PIN."
|
|
1742
|
+#elif AXIS_DRIVER_TYPE(Y, TMC2208) && !(defined(Y_HARDWARE_SERIAL) || (PIN_EXISTS(Y_SERIAL_RX) && PIN_EXISTS(Y_SERIAL_TX)))
|
|
1743
|
+ #error "TMC2208 on Y requires Y_HARDWARE_SERIAL or both Y_SERIAL_RX_PIN and Y_SERIAL_TX_PIN."
|
|
1744
|
+#elif AXIS_DRIVER_TYPE(Y2, TMC2208) && !(defined(Y2_HARDWARE_SERIAL) || (PIN_EXISTS(Y2_SERIAL_RX) && PIN_EXISTS(Y2_SERIAL_TX)))
|
|
1745
|
+ #error "TMC2208 on Y2 requires Y2_HARDWARE_SERIAL or both Y2_SERIAL_RX_PIN and Y2_SERIAL_TX_PIN."
|
|
1746
|
+#elif AXIS_DRIVER_TYPE(Z, TMC2208) && !(defined(Z_HARDWARE_SERIAL) || (PIN_EXISTS(Z_SERIAL_RX) && PIN_EXISTS(Z_SERIAL_TX)))
|
|
1747
|
+ #error "TMC2208 on Z requires Z_HARDWARE_SERIAL or both Z_SERIAL_RX_PIN and Z_SERIAL_TX_PIN."
|
|
1748
|
+#elif AXIS_DRIVER_TYPE(Z2, TMC2208) && !(defined(Z2_HARDWARE_SERIAL) || (PIN_EXISTS(Z2_SERIAL_RX) && PIN_EXISTS(Z2_SERIAL_TX)))
|
|
1749
|
+ #error "TMC2208 on Z2 requires Z2_HARDWARE_SERIAL or both Z2_SERIAL_RX_PIN and Z2_SERIAL_TX_PIN."
|
|
1750
|
+#elif AXIS_DRIVER_TYPE(Z3, TMC2208) && !(defined(Z3_HARDWARE_SERIAL) || (PIN_EXISTS(Z3_SERIAL_RX) && PIN_EXISTS(Z3_SERIAL_TX)))
|
|
1751
|
+ #error "TMC2208 on Z3 requires Z3_HARDWARE_SERIAL or both Z3_SERIAL_RX_PIN and Z3_SERIAL_TX_PIN."
|
|
1752
|
+#elif AXIS_DRIVER_TYPE(E0, TMC2208) && !(defined(E0_HARDWARE_SERIAL) || (PIN_EXISTS(E0_SERIAL_RX) && PIN_EXISTS(E0_SERIAL_TX)))
|
|
1753
|
+ #error "TMC2208 on E0 requires E0_HARDWARE_SERIAL or both E0_SERIAL_RX_PIN and E0_SERIAL_TX_PIN."
|
|
1754
|
+#elif AXIS_DRIVER_TYPE(E1, TMC2208) && !(defined(E1_HARDWARE_SERIAL) || (PIN_EXISTS(E1_SERIAL_RX) && PIN_EXISTS(E1_SERIAL_TX)))
|
|
1755
|
+ #error "TMC2208 on E1 requires E1_HARDWARE_SERIAL or both E1_SERIAL_RX_PIN and E1_SERIAL_TX_PIN."
|
|
1756
|
+#elif AXIS_DRIVER_TYPE(E2, TMC2208) && !(defined(E2_HARDWARE_SERIAL) || (PIN_EXISTS(E2_SERIAL_RX) && PIN_EXISTS(E2_SERIAL_TX)))
|
|
1757
|
+ #error "TMC2208 on E2 requires E2_HARDWARE_SERIAL or both E2_SERIAL_RX_PIN and E2_SERIAL_TX_PIN."
|
|
1758
|
+#elif AXIS_DRIVER_TYPE(E3, TMC2208) && !(defined(E3_HARDWARE_SERIAL) || (PIN_EXISTS(E3_SERIAL_RX) && PIN_EXISTS(E3_SERIAL_TX)))
|
|
1759
|
+ #error "TMC2208 on E3 requires E3_HARDWARE_SERIAL or both E3_SERIAL_RX_PIN and E3_SERIAL_TX_PIN."
|
|
1760
|
+#elif AXIS_DRIVER_TYPE(E4, TMC2208) && !(defined(E4_HARDWARE_SERIAL) || (PIN_EXISTS(E4_SERIAL_RX) && PIN_EXISTS(E4_SERIAL_TX)))
|
|
1761
|
+ #error "TMC2208 on E4 requires E4_HARDWARE_SERIAL or both E4_SERIAL_RX_PIN and E4_SERIAL_TX_PIN."
|
|
1762
|
+#elif AXIS_DRIVER_TYPE(E5, TMC2208) && !(defined(E5_HARDWARE_SERIAL) || (PIN_EXISTS(E5_SERIAL_RX) && PIN_EXISTS(E5_SERIAL_TX)))
|
|
1763
|
+ #error "TMC2208 on E5 requires E5_HARDWARE_SERIAL or both E5_SERIAL_RX_PIN and E5_SERIAL_TX_PIN."
|
1735
|
1764
|
#endif
|
1736
|
1765
|
|
1737
|
1766
|
/**
|
|
@@ -1797,6 +1826,15 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE && Y_MAX_LENGTH >= Y_BED_SIZE,
|
1797
|
1826
|
#endif
|
1798
|
1827
|
#endif
|
1799
|
1828
|
|
|
1829
|
+// Sensorless homing/probing requirements
|
|
1830
|
+#if ENABLED(SENSORLESS_HOMING) && !(X_SENSORLESS || Y_SENSORLESS || Z_SENSORLESS)
|
|
1831
|
+ #error "SENSORLESS_HOMING requires a TMC stepper driver with StallGuard on X, Y, or Z axes."
|
|
1832
|
+#elif ENABLED(SENSORLESS_PROBING) && ENABLED(DELTA) && !(X_SENSORLESS && Y_SENSORLESS && Z_SENSORLESS)
|
|
1833
|
+ #error "SENSORLESS_PROBING for DELTA requires TMC stepper drivers with StallGuard on X, Y, and Z axes."
|
|
1834
|
+#elif ENABLED(SENSORLESS_PROBING) && !Z_SENSORLESS
|
|
1835
|
+ #error "SENSORLESS_PROBING requires a TMC stepper driver with StallGuard on Z."
|
|
1836
|
+#endif
|
|
1837
|
+
|
1800
|
1838
|
// Sensorless homing is required for both combined steppers in an H-bot
|
1801
|
1839
|
#if CORE_IS_XY && X_SENSORLESS != Y_SENSORLESS
|
1802
|
1840
|
#error "CoreXY requires both X and Y to use sensorless homing if either does."
|
|
@@ -1904,5 +1942,3 @@ static_assert(COUNT(sanity_arr_3) <= XYZE_N, "DEFAULT_MAX_ACCELERATION has too m
|
1904
|
1942
|
#if ENABLED(SD_FIRMWARE_UPDATE) && !defined(__AVR_ATmega2560__)
|
1905
|
1943
|
#error "SD_FIRMWARE_UPDATE requires an ATmega2560-based (Arduino Mega) board."
|
1906
|
1944
|
#endif
|
1907
|
|
-
|
1908
|
|
-#endif // _SANITYCHECK_H_
|