Pārlūkot izejas kodu

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

Co-authored-by: Scott Lahteine <github@thinkyhead.com>
ellensp 3 gadus atpakaļ
vecāks
revīzija
ecc138fc9e
Revīzijas autora e-pasta adrese nav piesaistīta nevienam kontam

+ 24
- 0
Marlin/src/HAL/AVR/inc/SanityCheck.h Parādīt failu

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
  * Checks for FAST PWM
53
  * Checks for FAST PWM
30
  */
54
  */
31
 #if ALL(FAST_PWM_FAN, USE_OCR2A_AS_TOP, HAS_TCCR2)
55
 #if ALL(FAST_PWM_FAN, USE_OCR2A_AS_TOP, HAS_TCCR2)

+ 24
- 0
Marlin/src/HAL/DUE/inc/SanityCheck.h Parādīt failu

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
  * HARDWARE VS. SOFTWARE SPI COMPATIBILITY
53
  * HARDWARE VS. SOFTWARE SPI COMPATIBILITY
30
  *
54
  *
31
  * DUE selects hardware vs. software SPI depending on whether one of the hardware-controllable SDSS pins is in use.
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 Parādīt failu

27
 
27
 
28
 #define BOARD_INFO_NAME "GT2560 V3.0 (MC2)"
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
 #include "pins_GT2560_V3.h"
35
 #include "pins_GT2560_V3.h"

+ 27
- 0
Marlin/src/pins/pins_postprocess.h Parādīt failu

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

+ 1
- 1
buildroot/tests/FYSETC_F6 Parādīt failu

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

Notiek ielāde…
Atcelt
Saglabāt