Browse Source

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

Scott Lahteine 2 years ago
parent
commit
2bb9e0d58e
No account linked to committer's email address

+ 0
- 7
Marlin/Configuration.h View File

2732
 // Touch-screen LCD for Malyan M200/M300 printers
2732
 // Touch-screen LCD for Malyan M200/M300 printers
2733
 //
2733
 //
2734
 //#define MALYAN_LCD
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
 // Touch UI for FTDI EVE (FT800/FT810) displays
2737
 // Touch UI for FTDI EVE (FT800/FT810) displays
2748
 //#define ANYCUBIC_LCD_I3MEGA
2745
 //#define ANYCUBIC_LCD_I3MEGA
2749
 //#define ANYCUBIC_LCD_CHIRON
2746
 //#define ANYCUBIC_LCD_CHIRON
2750
 #if EITHER(ANYCUBIC_LCD_I3MEGA, ANYCUBIC_LCD_CHIRON)
2747
 #if EITHER(ANYCUBIC_LCD_I3MEGA, ANYCUBIC_LCD_CHIRON)
2751
-  #define LCD_SERIAL_PORT 3  // Default is 3 for Anycubic
2752
   //#define ANYCUBIC_LCD_DEBUG
2748
   //#define ANYCUBIC_LCD_DEBUG
2753
 #endif
2749
 #endif
2754
 
2750
 
2756
 // 320x240 Nextion 2.8" serial TFT Resistive Touch Screen NX3224T028
2752
 // 320x240 Nextion 2.8" serial TFT Resistive Touch Screen NX3224T028
2757
 //
2753
 //
2758
 //#define NEXTION_TFT
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
 // Third-party or vendor-customized controller interfaces.
2757
 // Third-party or vendor-customized controller interfaces.

+ 0
- 1
Marlin/Configuration_adv.h View File

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

+ 0
- 9
Marlin/src/inc/Conditionals_LCD.h View File

485
 // E3V2 extras
485
 // E3V2 extras
486
 #if HAS_DWIN_E3V2 || IS_DWIN_MARLINUI
486
 #if HAS_DWIN_E3V2 || IS_DWIN_MARLINUI
487
   #define SERIAL_CATCHALL 0
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
   #define HAS_LCD_BRIGHTNESS 1
488
   #define HAS_LCD_BRIGHTNESS 1
498
   #define LCD_BRIGHTNESS_MAX 250
489
   #define LCD_BRIGHTNESS_MAX 250
499
   #if ENABLED(DWIN_LCD_PROUI)
490
   #if ENABLED(DWIN_LCD_PROUI)

+ 18
- 0
Marlin/src/inc/Conditionals_adv.h View File

1014
   #define HAS_USER_ITEM(N) 0
1014
   #define HAS_USER_ITEM(N) 0
1015
 #endif
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
 #if !HAS_MULTI_SERIAL
1035
 #if !HAS_MULTI_SERIAL
1018
   #undef MEATPACK_ON_SERIAL_PORT_2
1036
   #undef MEATPACK_ON_SERIAL_PORT_2
1019
 #endif
1037
 #endif

+ 2
- 0
Marlin/src/inc/SanityCheck.h View File

3035
     #error "The ANYCUBIC LCD requires LCD_SERIAL_PORT to be defined."
3035
     #error "The ANYCUBIC LCD requires LCD_SERIAL_PORT to be defined."
3036
   #elif ENABLED(MALYAN_LCD)
3036
   #elif ENABLED(MALYAN_LCD)
3037
     #error "MALYAN_LCD requires LCD_SERIAL_PORT to be defined."
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
   #endif
3040
   #endif
3039
 #endif
3041
 #endif
3040
 
3042
 

+ 4
- 0
Marlin/src/inc/Warnings.cpp View File

71
 
71
 
72
 #ifndef NO_AUTO_ASSIGN_WARNING
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
   #if AUTO_ASSIGNED_X2_STEPPER
78
   #if AUTO_ASSIGNED_X2_STEPPER
75
     #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.)"
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
   #endif
80
   #endif

Loading…
Cancel
Save