Skip to content

Commit

Permalink
🔧 Fix LCD_SERIAL_PORT config
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Apr 25, 2023
1 parent 650e6fc commit d1738e9
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 34 deletions.
23 changes: 11 additions & 12 deletions Marlin/src/inc/Conditionals_LCD.h
Original file line number Diff line number Diff line change
Expand Up @@ -488,13 +488,8 @@
#endif
#endif

// Serial Controllers require LCD_SERIAL_PORT
#if ANY(HAS_DGUS_LCD, MALYAN_LCD, ANYCUBIC_LCD_I3MEGA, ANYCUBIC_LCD_CHIRON, NEXTION_TFT)
#define LCD_NEEDS_SERIAL_PORT 1
#endif

// Extensible UI serial touch screens. (See src/lcd/extui)
#if EITHER(LCD_NEEDS_SERIAL_PORT, TOUCH_UI_FTDI_EVE)
#if ANY(HAS_DGUS_LCD, MALYAN_LCD, ANYCUBIC_LCD_I3MEGA, ANYCUBIC_LCD_CHIRON, NEXTION_TFT, TOUCH_UI_FTDI_EVE)
#define IS_EXTUI 1
#define EXTENSIBLE_UI
#endif
Expand All @@ -506,18 +501,22 @@
#if EITHER(HAS_DWIN_E3V2_BASIC, DWIN_CREALITY_LCD_JYERSUI)
#define HAS_DWIN_E3V2 1
#endif
#if ENABLED(DWIN_LCD_PROUI)
#define DO_LIST_BIN_FILES 1
#endif

// E3V2 extras
#if HAS_DWIN_E3V2 || IS_DWIN_MARLINUI
#define SERIAL_CATCHALL 0
#define HAS_LCD_BRIGHTNESS 1
#define LCD_BRIGHTNESS_MAX 250
#if ENABLED(DWIN_LCD_PROUI)
#define LCD_BRIGHTNESS_DEFAULT 127
#endif
#endif

#if ENABLED(DWIN_LCD_PROUI)
#define DO_LIST_BIN_FILES 1
#define LCD_BRIGHTNESS_DEFAULT 127
#endif

// Serial Controllers require LCD_SERIAL_PORT
#if ANY(IS_DWIN_MARLINUI, HAS_DWIN_E3V2, HAS_DGUS_LCD, MALYAN_LCD, ANYCUBIC_LCD_I3MEGA, ANYCUBIC_LCD_CHIRON, NEXTION_TFT)
#define LCD_IS_SERIAL_HOST 1
#endif

#if HAS_WIRED_LCD
Expand Down
19 changes: 9 additions & 10 deletions Marlin/src/inc/Conditionals_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -1203,17 +1203,16 @@
#endif

/**
* LCD_SERIAL_PORT must be defined ahead of HAL.h
* LCD_SERIAL_PORT must be defined ahead of HAL.h and
* currently HAL.h must be included ahead of pins.h.
*/
#ifndef LCD_SERIAL_PORT
#if HAS_DWIN_E3V2 || IS_DWIN_MARLINUI || HAS_DGUS_LCD
#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, BTT_OCTOPUS_V1_1)
#define LCD_SERIAL_PORT 1
#elif MB(CREALITY_V24S1_301, CREALITY_V24S1_301F4, CREALITY_V423, MKS_ROBIN)
#define LCD_SERIAL_PORT 2 // Creality Ender3S1, MKS Robin
#else
#define LCD_SERIAL_PORT 3 // Other boards
#endif
#if LCD_IS_SERIAL_HOST && !defined(LCD_SERIAL_PORT)
#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, BTT_OCTOPUS_V1_1)
#define LCD_SERIAL_PORT 1
#elif MB(CREALITY_V24S1_301, CREALITY_V24S1_301F4, CREALITY_V423, MKS_ROBIN, PANOWIN_CUTLASS, KODAMA_BARDO)
#define LCD_SERIAL_PORT 2
#else
#define LCD_SERIAL_PORT 3
#endif
#ifdef LCD_SERIAL_PORT
#define AUTO_ASSIGNED_LCD_SERIAL 1
Expand Down
7 changes: 0 additions & 7 deletions Marlin/src/pins/ramps/pins_PANOWIN_CUTLASS.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,6 @@
#define SPINDLE_LASER_ENA_PIN 74 // J7
#endif

//
// Serial LCD
//
#if LCD_NEEDS_SERIAL_PORT && !defined(LCD_SERIAL_PORT)
#define LCD_SERIAL_PORT 2 // D16 H1 (TX2), D17 H0 (RX2)
#endif

//
// SD Card
//
Expand Down
5 changes: 0 additions & 5 deletions Marlin/src/pins/stm32f1/pins_CREALITY_V521.h
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,3 @@
#endif

#endif

// DGUS LCDs
#if HAS_DGUS_LCD
#define LCD_SERIAL_PORT 3
#endif

0 comments on commit d1738e9

Please sign in to comment.