Skip to content

Commit cfcc2df

Browse files
thinkyheadtomek2k1
authored andcommitted
🔧 Remove LCD_SERIAL_PORT defaults, warn on auto-assign (MarlinFirmware#24170)
1 parent 3048de0 commit cfcc2df

6 files changed

Lines changed: 24 additions & 17 deletions

File tree

Marlin/Configuration.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2676,9 +2676,6 @@
26762676
// Touch-screen LCD for Malyan M200/M300 printers
26772677
//
26782678
//#define MALYAN_LCD
2679-
#if ENABLED(MALYAN_LCD)
2680-
#define LCD_SERIAL_PORT 1 // Default is 1 for Malyan M200
2681-
#endif
26822679

26832680
//
26842681
// Touch UI for FTDI EVE (FT800/FT810) displays
@@ -2692,17 +2689,13 @@
26922689
//#define ANYCUBIC_LCD_I3MEGA
26932690
//#define ANYCUBIC_LCD_CHIRON
26942691
#if EITHER(ANYCUBIC_LCD_I3MEGA, ANYCUBIC_LCD_CHIRON)
2695-
#define LCD_SERIAL_PORT 3 // Default is 3 for Anycubic
26962692
//#define ANYCUBIC_LCD_DEBUG
26972693
#endif
26982694

26992695
//
27002696
// 320x240 Nextion 2.8" serial TFT Resistive Touch Screen NX3224T028
27012697
//
27022698
//#define NEXTION_TFT
2703-
#if ENABLED(NEXTION_TFT)
2704-
#define LCD_SERIAL_PORT 1 // Default is 1 for Nextion
2705-
#endif
27062699

27072700
//
27082701
// Third-party or vendor-customized controller interfaces.

Marlin/Configuration_adv.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1748,7 +1748,6 @@
17481748
// Additional options for DGUS / DWIN displays
17491749
//
17501750
#if HAS_DGUS_LCD
1751-
#define LCD_SERIAL_PORT 3
17521751
#define LCD_BAUDRATE 115200
17531752

17541753
#define DGUS_RX_BUFFER_SIZE 128

Marlin/src/inc/Conditionals_LCD.h

Lines changed: 0 additions & 9 deletions
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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,6 +1012,24 @@
10121012
#define HAS_USER_ITEM(N) 0
10131013
#endif
10141014

1015+
/**
1016+
* LCD_SERIAL_PORT must be defined ahead of HAL.h
1017+
*/
1018+
#ifndef LCD_SERIAL_PORT
1019+
#if HAS_DWIN_E3V2 || IS_DWIN_MARLINUI
1020+
#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)
1021+
#define LCD_SERIAL_PORT 1
1022+
#elif MB(CREALITY_V24S1_301, CREALITY_V24S1_301F4, CREALITY_V423)
1023+
#define LCD_SERIAL_PORT 2 // Creality Ender3S1 board
1024+
#else
1025+
#define LCD_SERIAL_PORT 3 // Creality 4.x board
1026+
#endif
1027+
#endif
1028+
#ifdef LCD_SERIAL_PORT
1029+
#define AUTO_ASSIGNED_LCD_SERIAL 1
1030+
#endif
1031+
#endif
1032+
10151033
#if !HAS_MULTI_SERIAL
10161034
#undef MEATPACK_ON_SERIAL_PORT_2
10171035
#endif

Marlin/src/inc/SanityCheck.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2941,6 +2941,8 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
29412941
#error "The ANYCUBIC LCD requires LCD_SERIAL_PORT to be defined."
29422942
#elif ENABLED(MALYAN_LCD)
29432943
#error "MALYAN_LCD requires LCD_SERIAL_PORT to be defined."
2944+
#elif ENABLED(NEXTION_LCD)
2945+
#error "NEXTION_LCD requires LCD_SERIAL_PORT to be defined."
29442946
#endif
29452947
#endif
29462948

Marlin/src/inc/Warnings.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@
6767

6868
#ifndef NO_AUTO_ASSIGN_WARNING
6969

70+
#if AUTO_ASSIGNED_LCD_SERIAL
71+
#warning "Note: Auto-assigned LCD_SERIAL_PORT. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
72+
#endif
73+
7074
#if AUTO_ASSIGNED_X2_STEPPER
7175
#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.)"
7276
#endif

0 commit comments

Comments
 (0)