Przeglądaj źródła

🔧 Remove LCD_SERIAL_PORT defaults, warn on auto-assign (#24170)

Scott Lahteine 2 lat temu
rodzic
commit
2bb9e0d58e
No account linked to committer's email address

+ 0
- 7
Marlin/Configuration.h Wyświetl plik

@@ -2732,9 +2732,6 @@
2732 2732
 // Touch-screen LCD for Malyan M200/M300 printers
2733 2733
 //
2734 2734
 //#define MALYAN_LCD
2735
-#if ENABLED(MALYAN_LCD)
2736
-  #define LCD_SERIAL_PORT 1  // Default is 1 for Malyan M200
2737
-#endif
2738 2735
 
2739 2736
 //
2740 2737
 // Touch UI for FTDI EVE (FT800/FT810) displays
@@ -2748,7 +2745,6 @@
2748 2745
 //#define ANYCUBIC_LCD_I3MEGA
2749 2746
 //#define ANYCUBIC_LCD_CHIRON
2750 2747
 #if EITHER(ANYCUBIC_LCD_I3MEGA, ANYCUBIC_LCD_CHIRON)
2751
-  #define LCD_SERIAL_PORT 3  // Default is 3 for Anycubic
2752 2748
   //#define ANYCUBIC_LCD_DEBUG
2753 2749
 #endif
2754 2750
 
@@ -2756,9 +2752,6 @@
2756 2752
 // 320x240 Nextion 2.8" serial TFT Resistive Touch Screen NX3224T028
2757 2753
 //
2758 2754
 //#define NEXTION_TFT
2759
-#if ENABLED(NEXTION_TFT)
2760
-  #define LCD_SERIAL_PORT 1  // Default is 1 for Nextion
2761
-#endif
2762 2755
 
2763 2756
 //
2764 2757
 // Third-party or vendor-customized controller interfaces.

+ 0
- 1
Marlin/Configuration_adv.h Wyświetl plik

@@ -1764,7 +1764,6 @@
1764 1764
 // Additional options for DGUS / DWIN displays
1765 1765
 //
1766 1766
 #if HAS_DGUS_LCD
1767
-  #define LCD_SERIAL_PORT 3
1768 1767
   #define LCD_BAUDRATE 115200
1769 1768
 
1770 1769
   #define DGUS_RX_BUFFER_SIZE 128

+ 0
- 9
Marlin/src/inc/Conditionals_LCD.h Wyświetl plik

@@ -485,15 +485,6 @@
485 485
 // E3V2 extras
486 486
 #if HAS_DWIN_E3V2 || IS_DWIN_MARLINUI
487 487
   #define SERIAL_CATCHALL 0
488
-  #ifndef LCD_SERIAL_PORT
489
-    #if MB(BTT_SKR_MINI_E3_V1_0, BTT_SKR_MINI_E3_V1_2, BTT_SKR_MINI_E3_V2_0, BTT_SKR_MINI_E3_V3_0, BTT_SKR_E3_TURBO)
490
-      #define LCD_SERIAL_PORT 1
491
-    #elif MB(CREALITY_V24S1_301, CREALITY_V24S1_301F4, CREALITY_V423)
492
-      #define LCD_SERIAL_PORT 2 // Creality Ender3S1 board
493
-    #else
494
-      #define LCD_SERIAL_PORT 3 // Creality 4.x board
495
-    #endif
496
-  #endif
497 488
   #define HAS_LCD_BRIGHTNESS 1
498 489
   #define LCD_BRIGHTNESS_MAX 250
499 490
   #if ENABLED(DWIN_LCD_PROUI)

+ 18
- 0
Marlin/src/inc/Conditionals_adv.h Wyświetl plik

@@ -1014,6 +1014,24 @@
1014 1014
   #define HAS_USER_ITEM(N) 0
1015 1015
 #endif
1016 1016
 
1017
+/**
1018
+ * LCD_SERIAL_PORT must be defined ahead of HAL.h
1019
+ */
1020
+#ifndef LCD_SERIAL_PORT
1021
+  #if HAS_DWIN_E3V2 || IS_DWIN_MARLINUI
1022
+    #if MB(BTT_SKR_MINI_E3_V1_0, BTT_SKR_MINI_E3_V1_2, BTT_SKR_MINI_E3_V2_0, BTT_SKR_MINI_E3_V3_0, BTT_SKR_E3_TURBO)
1023
+      #define LCD_SERIAL_PORT 1
1024
+    #elif MB(CREALITY_V24S1_301, CREALITY_V24S1_301F4, CREALITY_V423)
1025
+      #define LCD_SERIAL_PORT 2 // Creality Ender3S1 board
1026
+    #else
1027
+      #define LCD_SERIAL_PORT 3 // Creality 4.x board
1028
+    #endif
1029
+  #endif
1030
+  #ifdef LCD_SERIAL_PORT
1031
+    #define AUTO_ASSIGNED_LCD_SERIAL 1
1032
+  #endif
1033
+#endif
1034
+
1017 1035
 #if !HAS_MULTI_SERIAL
1018 1036
   #undef MEATPACK_ON_SERIAL_PORT_2
1019 1037
 #endif

+ 2
- 0
Marlin/src/inc/SanityCheck.h Wyświetl plik

@@ -3035,6 +3035,8 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
3035 3035
     #error "The ANYCUBIC LCD requires LCD_SERIAL_PORT to be defined."
3036 3036
   #elif ENABLED(MALYAN_LCD)
3037 3037
     #error "MALYAN_LCD requires LCD_SERIAL_PORT to be defined."
3038
+  #elif ENABLED(NEXTION_LCD)
3039
+    #error "NEXTION_LCD requires LCD_SERIAL_PORT to be defined."
3038 3040
   #endif
3039 3041
 #endif
3040 3042
 

+ 4
- 0
Marlin/src/inc/Warnings.cpp Wyświetl plik

@@ -71,6 +71,10 @@
71 71
 
72 72
 #ifndef NO_AUTO_ASSIGN_WARNING
73 73
 
74
+  #if AUTO_ASSIGNED_LCD_SERIAL
75
+    #warning "Note: Auto-assigned LCD_SERIAL_PORT. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
76
+  #endif
77
+
74 78
   #if AUTO_ASSIGNED_X2_STEPPER
75 79
     #warning "Note: Auto-assigned X2 STEP/DIR/ENABLE_PINs to unused En_STEP/DIR/ENABLE_PINs. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
76 80
   #endif

Ładowanie…
Anuluj
Zapisz