Skip to content

Commit eca2242

Browse files
thinkyheadLCh-77
authored andcommitted
🔧 Remove LCD_SERIAL_PORT defaults, warn on auto-assign (MarlinFirmware#24170)
1 parent 6b1b523 commit eca2242

6 files changed

+24
-17
lines changed

Marlin/Configuration.h

-7
Original file line numberDiff line numberDiff line change
@@ -2732,9 +2732,6 @@
27322732
// Touch-screen LCD for Malyan M200/M300 printers
27332733
//
27342734
//#define MALYAN_LCD
2735-
#if ENABLED(MALYAN_LCD)
2736-
#define LCD_SERIAL_PORT 1 // Default is 1 for Malyan M200
2737-
#endif
27382735

27392736
//
27402737
// Touch UI for FTDI EVE (FT800/FT810) displays
@@ -2748,17 +2745,13 @@
27482745
//#define ANYCUBIC_LCD_I3MEGA
27492746
//#define ANYCUBIC_LCD_CHIRON
27502747
#if EITHER(ANYCUBIC_LCD_I3MEGA, ANYCUBIC_LCD_CHIRON)
2751-
#define LCD_SERIAL_PORT 3 // Default is 3 for Anycubic
27522748
//#define ANYCUBIC_LCD_DEBUG
27532749
#endif
27542750

27552751
//
27562752
// 320x240 Nextion 2.8" serial TFT Resistive Touch Screen NX3224T028
27572753
//
27582754
//#define NEXTION_TFT
2759-
#if ENABLED(NEXTION_TFT)
2760-
#define LCD_SERIAL_PORT 1 // Default is 1 for Nextion
2761-
#endif
27622755

27632756
//
27642757
// Third-party or vendor-customized controller interfaces.

Marlin/Configuration_adv.h

-1
Original file line numberDiff line numberDiff line change
@@ -1764,7 +1764,6 @@
17641764
// Additional options for DGUS / DWIN displays
17651765
//
17661766
#if HAS_DGUS_LCD
1767-
#define LCD_SERIAL_PORT 3
17681767
#define LCD_BAUDRATE 115200
17691768

17701769
#define DGUS_RX_BUFFER_SIZE 128

Marlin/src/inc/Conditionals_LCD.h

-9
Original file line numberDiff line numberDiff line change
@@ -485,15 +485,6 @@
485485
// E3V2 extras
486486
#if HAS_DWIN_E3V2 || IS_DWIN_MARLINUI
487487
#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
497488
#define HAS_LCD_BRIGHTNESS 1
498489
#define LCD_BRIGHTNESS_MAX 250
499490
#if ENABLED(DWIN_LCD_PROUI)

Marlin/src/inc/Conditionals_adv.h

+18
Original file line numberDiff line numberDiff line change
@@ -1014,6 +1014,24 @@
10141014
#define HAS_USER_ITEM(N) 0
10151015
#endif
10161016

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+
10171035
#if !HAS_MULTI_SERIAL
10181036
#undef MEATPACK_ON_SERIAL_PORT_2
10191037
#endif

Marlin/src/inc/SanityCheck.h

+2
Original file line numberDiff line numberDiff line change
@@ -3039,6 +3039,8 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L
30393039
#error "The ANYCUBIC LCD requires LCD_SERIAL_PORT to be defined."
30403040
#elif ENABLED(MALYAN_LCD)
30413041
#error "MALYAN_LCD requires LCD_SERIAL_PORT to be defined."
3042+
#elif ENABLED(NEXTION_LCD)
3043+
#error "NEXTION_LCD requires LCD_SERIAL_PORT to be defined."
30423044
#endif
30433045
#endif
30443046

Marlin/src/inc/Warnings.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@
7171

7272
#ifndef NO_AUTO_ASSIGN_WARNING
7373

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+
7478
#if AUTO_ASSIGNED_X2_STEPPER
7579
#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.)"
7680
#endif

0 commit comments

Comments
 (0)