Procházet zdrojové kódy

🔧 AVR/DUE Serial Port pin conflict checks (#24148)

Co-authored-by: Scott Lahteine <github@thinkyhead.com>
ellensp před 2 roky
rodič
revize
ecc138fc9e
No account linked to committer's email address

+ 24
- 0
Marlin/src/HAL/AVR/inc/SanityCheck.h Zobrazit soubor

@@ -26,6 +26,30 @@
26 26
  */
27 27
 
28 28
 /**
29
+ * Check for common serial pin conflicts
30
+ */
31
+#define CHECK_SERIAL_PIN(N) ( \
32
+     X_STOP_PIN == N || Y_STOP_PIN == N || Z_STOP_PIN == N \
33
+  || X_MIN_PIN  == N || Y_MIN_PIN  == N || Z_MIN_PIN  == N \
34
+  || X_MAX_PIN  == N || Y_MAX_PIN  == N || Z_MAX_PIN  == N \
35
+  || X_STEP_PIN == N || Y_STEP_PIN == N || Z_STEP_PIN == N \
36
+  || X_DIR_PIN  == N || Y_DIR_PIN  == N || Z_DIR_PIN  == N \
37
+  || X_ENA_PIN  == N || Y_ENA_PIN  == N || Z_ENA_PIN  == N \
38
+)
39
+#if CONF_SERIAL_IS(0) // D0-D1. No known conflicts.
40
+#endif 
41
+#if CONF_SERIAL_IS(1) && (CHECK_SERIAL_PIN(18) || CHECK_SERIAL_PIN(19))
42
+  #error "Serial Port 1 pin D18 and/or D19 conflicts with another pin on the board."
43
+#endif 
44
+#if CONF_SERIAL_IS(2) && (CHECK_SERIAL_PIN(16) || CHECK_SERIAL_PIN(17))
45
+  #error "Serial Port 2 pin D16 and/or D17 conflicts with another pin on the board."
46
+#endif
47
+#if CONF_SERIAL_IS(3) && (CHECK_SERIAL_PIN(14) || CHECK_SERIAL_PIN(15))
48
+  #error "Serial Port 3 pin D14 and/or D15 conflicts with another pin on the board."
49
+#endif 
50
+#undef CHECK_SERIAL_PIN
51
+
52
+/**
29 53
  * Checks for FAST PWM
30 54
  */
31 55
 #if ALL(FAST_PWM_FAN, USE_OCR2A_AS_TOP, HAS_TCCR2)

+ 24
- 0
Marlin/src/HAL/DUE/inc/SanityCheck.h Zobrazit soubor

@@ -26,6 +26,30 @@
26 26
  */
27 27
 
28 28
 /**
29
+ * Check for common serial pin conflicts
30
+ */
31
+#define CHECK_SERIAL_PIN(N) ( \
32
+     X_STOP_PIN == N || Y_STOP_PIN == N || Z_STOP_PIN == N \
33
+  || X_MIN_PIN  == N || Y_MIN_PIN  == N || Z_MIN_PIN  == N \
34
+  || X_MAX_PIN  == N || Y_MAX_PIN  == N || Z_MAX_PIN  == N \
35
+  || X_STEP_PIN == N || Y_STEP_PIN == N || Z_STEP_PIN == N \
36
+  || X_DIR_PIN  == N || Y_DIR_PIN  == N || Z_DIR_PIN  == N \
37
+  || X_ENA_PIN  == N || Y_ENA_PIN  == N || Z_ENA_PIN  == N \
38
+)
39
+#if CONF_SERIAL_IS(0) // D0-D1. No known conflicts.
40
+#endif 
41
+#if CONF_SERIAL_IS(1) && (CHECK_SERIAL_PIN(18) || CHECK_SERIAL_PIN(19))
42
+  #error "Serial Port 1 pin D18 and/or D19 conflicts with another pin on the board."
43
+#endif 
44
+#if CONF_SERIAL_IS(2) && (CHECK_SERIAL_PIN(16) || CHECK_SERIAL_PIN(17))
45
+  #error "Serial Port 2 pin D16 and/or D17 conflicts with another pin on the board."
46
+#endif
47
+#if CONF_SERIAL_IS(3) && (CHECK_SERIAL_PIN(14) || CHECK_SERIAL_PIN(15))
48
+  #error "Serial Port 3 pin D14 and/or D15 conflicts with another pin on the board."
49
+#endif 
50
+#undef CHECK_SERIAL_PIN
51
+
52
+/**
29 53
  * HARDWARE VS. SOFTWARE SPI COMPATIBILITY
30 54
  *
31 55
  * DUE selects hardware vs. software SPI depending on whether one of the hardware-controllable SDSS pins is in use.

+ 4
- 4
Marlin/src/pins/mega/pins_GT2560_V3_MC2.h Zobrazit soubor

@@ -27,9 +27,9 @@
27 27
 
28 28
 #define BOARD_INFO_NAME "GT2560 V3.0 (MC2)"
29 29
 
30
-#define X_MIN_PIN                            22
31
-#define X_MAX_PIN                            24
32
-#define Y_MIN_PIN                            26
33
-#define Y_MAX_PIN                            28
30
+#define X_MIN_PIN                             22
31
+#define X_MAX_PIN                             24
32
+#define Y_MIN_PIN                             26
33
+#define Y_MAX_PIN                             28
34 34
 
35 35
 #include "pins_GT2560_V3.h"

+ 27
- 0
Marlin/src/pins/pins_postprocess.h Zobrazit soubor

@@ -1664,6 +1664,9 @@
1664 1664
   #undef X_MAX_PIN
1665 1665
   #define X_MAX_PIN          -1
1666 1666
 #endif
1667
+#if NONE(USE_XMIN_PLUG, USE_XMAX_PLUG)
1668
+  #undef X_STOP_PIN
1669
+#endif
1667 1670
 #if DISABLED(USE_YMIN_PLUG)
1668 1671
   #undef Y_MIN_PIN
1669 1672
   #define Y_MIN_PIN          -1
@@ -1672,6 +1675,9 @@
1672 1675
   #undef Y_MAX_PIN
1673 1676
   #define Y_MAX_PIN          -1
1674 1677
 #endif
1678
+#if NONE(USE_YMIN_PLUG, USE_YMAX_PLUG)
1679
+  #undef Y_STOP_PIN
1680
+#endif
1675 1681
 #if DISABLED(USE_ZMIN_PLUG)
1676 1682
   #undef Z_MIN_PIN
1677 1683
   #define Z_MIN_PIN          -1
@@ -1680,6 +1686,9 @@
1680 1686
   #undef Z_MAX_PIN
1681 1687
   #define Z_MAX_PIN          -1
1682 1688
 #endif
1689
+#if NONE(USE_ZMIN_PLUG, USE_ZMAX_PLUG)
1690
+  #undef Z_STOP_PIN
1691
+#endif
1683 1692
 #if DISABLED(USE_IMIN_PLUG)
1684 1693
   #undef I_MIN_PIN
1685 1694
   #define I_MIN_PIN          -1
@@ -1688,6 +1697,9 @@
1688 1697
   #undef I_MAX_PIN
1689 1698
   #define I_MAX_PIN          -1
1690 1699
 #endif
1700
+#if NONE(USE_IMIN_PLUG, USE_IMAX_PLUG)
1701
+  #undef I_STOP_PIN
1702
+#endif
1691 1703
 #if DISABLED(USE_JMIN_PLUG)
1692 1704
   #undef J_MIN_PIN
1693 1705
   #define J_MIN_PIN          -1
@@ -1696,6 +1708,9 @@
1696 1708
   #undef J_MAX_PIN
1697 1709
   #define J_MAX_PIN          -1
1698 1710
 #endif
1711
+#if NONE(USE_JMIN_PLUG, USE_JMAX_PLUG)
1712
+  #undef J_STOP_PIN
1713
+#endif
1699 1714
 #if DISABLED(USE_KMIN_PLUG)
1700 1715
   #undef K_MIN_PIN
1701 1716
   #define K_MIN_PIN          -1
@@ -1704,6 +1719,9 @@
1704 1719
   #undef K_MAX_PIN
1705 1720
   #define K_MAX_PIN          -1
1706 1721
 #endif
1722
+#if NONE(USE_KMIN_PLUG, USE_KMAX_PLUG)
1723
+  #undef K_STOP_PIN
1724
+#endif
1707 1725
 #if DISABLED(USE_UMIN_PLUG)
1708 1726
   #undef U_MIN_PIN
1709 1727
   #define U_MIN_PIN          -1
@@ -1712,6 +1730,9 @@
1712 1730
   #undef U_MAX_PIN
1713 1731
   #define U_MAX_PIN          -1
1714 1732
 #endif
1733
+#if NONE(USE_UMIN_PLUG, USE_UMAX_PLUG)
1734
+  #undef U_STOP_PIN
1735
+#endif
1715 1736
 #if DISABLED(USE_VMIN_PLUG)
1716 1737
   #undef V_MIN_PIN
1717 1738
   #define V_MIN_PIN          -1
@@ -1720,6 +1741,9 @@
1720 1741
   #undef V_MAX_PIN
1721 1742
   #define V_MAX_PIN          -1
1722 1743
 #endif
1744
+#if NONE(USE_VMIN_PLUG, USE_VMAX_PLUG)
1745
+  #undef V_STOP_PIN
1746
+#endif
1723 1747
 #if DISABLED(USE_WMIN_PLUG)
1724 1748
   #undef W_MIN_PIN
1725 1749
   #define W_MIN_PIN          -1
@@ -1728,6 +1752,9 @@
1728 1752
   #undef W_MAX_PIN
1729 1753
   #define W_MAX_PIN          -1
1730 1754
 #endif
1755
+#if NONE(USE_WMIN_PLUG, USE_WMAX_PLUG)
1756
+  #undef W_STOP_PIN
1757
+#endif
1731 1758
 
1732 1759
 #if DISABLED(X_DUAL_ENDSTOPS) || X_HOME_TO_MAX
1733 1760
   #undef X2_MIN_PIN

+ 1
- 1
buildroot/tests/FYSETC_F6 Zobrazit soubor

@@ -10,7 +10,7 @@ set -e
10 10
 # Build with the default configurations
11 11
 #
12 12
 restore_configs
13
-opt_set MOTHERBOARD BOARD_FYSETC_F6_13
13
+opt_set MOTHERBOARD BOARD_FYSETC_F6_13 LCD_SERIAL_PORT 1
14 14
 opt_enable DGUS_LCD_UI_FYSETC
15 15
 exec_test $1 $2 "FYSETC F6 1.3 with DGUS" "$3"
16 16
 

Loading…
Zrušit
Uložit