Skip to content

Commit 8c4bf72

Browse files
committed
cleanup
1 parent cbf4a73 commit 8c4bf72

16 files changed

Lines changed: 2767 additions & 3070 deletions

Marlin/Configuration.h

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2939,23 +2939,16 @@
29392939

29402940
/**
29412941
* DGUS Touch Display with DWIN OS. (Choose one.)
2942-
* ORIGIN : https://www.aliexpress.com/item/32993409517.html
2943-
* FYSETC : https://www.aliexpress.com/item/32961471929.html
2944-
* MKS : https://www.aliexpress.com/item/1005002008179262.html
2945-
*
2946-
* Flash display with DGUS Displays for Marlin:
2947-
* - Format the SD card to FAT32 with an allocation size of 4kb.
2948-
* - Download files as specified for your type of display.
2949-
* - Plug the microSD card into the back of the display.
2950-
* - Boot the display and wait for the update to complete.
29512942
*
29522943
* ORIGIN (Marlin DWIN_SET)
29532944
* - Download https://github.com/coldtobi/Marlin_DGUS_Resources
29542945
* - Copy the downloaded DWIN_SET folder to the SD card.
2946+
* - Product: https://www.aliexpress.com/item/32993409517.html
29552947
*
29562948
* FYSETC (Supplier default)
29572949
* - Download https://github.com/FYSETC/FYSTLCD-2.0
29582950
* - Copy the downloaded SCREEN folder to the SD card.
2951+
* - Product: https://www.aliexpress.com/item/32961471929.html
29592952
*
29602953
* HIPRECY (Supplier default)
29612954
* - Download https://github.com/HiPrecy/Touch-Lcd-LEO
@@ -2964,6 +2957,7 @@
29642957
* MKS (MKS-H43) (Supplier default)
29652958
* - Download https://github.com/makerbase-mks/MKS-H43
29662959
* - Copy the downloaded DWIN_SET folder to the SD card.
2960+
* - Product: https://www.aliexpress.com/item/1005002008179262.html
29672961
*
29682962
* RELOADED (T5UID1)
29692963
* - Download https://github.com/Desuuuu/DGUS-reloaded/releases
@@ -2972,14 +2966,15 @@
29722966
* IA_CREALITY (T5UID1)
29732967
* - Download https://github.com/InsanityAutomation/Marlin/raw/CrealityDwin2.0_Bleeding/TM3D_Combined480272_Landscape_V7.7z
29742968
* - Copy the downloaded DWIN_SET folder to the SD card.
2969+
*
2970+
* Flash display with DGUS Displays for Marlin:
2971+
* - Format the SD card to FAT32 with an allocation size of 4kb.
2972+
* - Download files as specified for your type of display.
2973+
* - Plug the microSD card into the back of the display.
2974+
* - Boot the display and wait for the update to complete.
29752975
*/
2976-
//#define DGUS_LCD_UI_ORIGIN
2977-
//#define DGUS_LCD_UI_FYSETC
2978-
//#define DGUS_LCD_UI_HIPRECY
2979-
//#define DGUS_LCD_UI_MKS
2980-
//#define DGUS_LCD_UI_RELOADED
2981-
//#define DGUS_LCD_UI_IA_CREALITY
2982-
#if ENABLED(DGUS_LCD_UI_MKS)
2976+
//#define DGUS_LCD_UI ORIGIN
2977+
#if DGUS_UI_IS(MKS)
29832978
#define USE_MKS_GREEN_UI
29842979
#endif
29852980

Marlin/Configuration_adv.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1864,11 +1864,11 @@
18641864

18651865
#define DGUS_UPDATE_INTERVAL_MS 500 // (ms) Interval between automatic screen updates
18661866

1867-
#if ANY(DGUS_LCD_UI_FYSETC, DGUS_LCD_UI_MKS, DGUS_LCD_UI_HIPRECY)
1867+
#if DGUS_UI_IS(FYSETC, MKS, HIPRECY)
18681868
#define DGUS_PRINT_FILENAME // Display the filename during printing
18691869
#define DGUS_PREHEAT_UI // Display a preheat screen during heatup
18701870

1871-
#if EITHER(DGUS_LCD_UI_FYSETC, DGUS_LCD_UI_MKS)
1871+
#if DGUS_UI_IS(FYSETC, MKS)
18721872
//#define DGUS_UI_MOVE_DIS_OPTION // Disabled by default for FYSETC and MKS
18731873
#else
18741874
#define DGUS_UI_MOVE_DIS_OPTION // Enabled by default for UI_HIPRECY

Marlin/src/core/macros.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -742,3 +742,13 @@
742742
#define _HAS_E_TEMP(N) || TEMP_SENSOR(N)
743743
#define HAS_E_TEMP_SENSOR (0 REPEAT(EXTRUDERS, _HAS_E_TEMP))
744744
#define TEMP_SENSOR_IS_MAX_TC(T) (TEMP_SENSOR(T) == -5 || TEMP_SENSOR(T) == -3 || TEMP_SENSOR(T) == -2)
745+
746+
#define _UI_NONE 0
747+
#define _UI_ORIGIN 101
748+
#define _UI_FYSETC 102
749+
#define _UI_HIPRECY 103
750+
#define _UI_MKS 104
751+
#define _UI_RELOADED 105
752+
#define _UI_IA_CREALITY 106
753+
#define _DGUS_UI_IS(N) || (DGUS_LCD_UI == _UI_ ## N)
754+
#define DGUS_UI_IS(V...) (0 MAP(_DGUS_UI_IS, V))

Marlin/src/inc/Conditionals_LCD.h

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,21 @@
3636
#define FYSETC_MINI_12864_2_1
3737
#endif
3838

39+
// Updated DGUS_UI shorthand single option can be used, or old settings, for now
40+
#if DGUS_UI_IS(ORIGIN)
41+
#define DGUS_LCD_UI_ORIGIN
42+
#elif DGUS_UI_IS(FYSETC)
43+
#define DGUS_LCD_UI_FYSETC
44+
#elif DGUS_UI_IS(HIPRECY)
45+
#define DGUS_LCD_UI_HIPRECY
46+
#elif DGUS_UI_IS(MKS)
47+
#define DGUS_LCD_UI_MKS
48+
#elif DGUS_UI_IS(RELOADED)
49+
#define DGUS_LCD_UI_RELOADED
50+
#elif DGUS_UI_IS(IA_CREALITY)
51+
#define DGUS_LCD_UI_IA_CREALITY
52+
#endif
53+
3954
/**
4055
* General Flags that may be set below by specific LCDs
4156
*
@@ -462,11 +477,11 @@
462477
#endif
463478

464479
// Aliases for LCD features
465-
#if ANY(DGUS_LCD_UI_ORIGIN, DGUS_LCD_UI_FYSETC, DGUS_LCD_UI_HIPRECY, DGUS_LCD_UI_MKS)
480+
#if DGUS_UI_IS(ORIGIN, FYSETC, HIPRECY, MKS)
466481
#define HAS_DGUS_LCD_CLASSIC 1
467482
#endif
468483

469-
#if ANY(HAS_DGUS_LCD_CLASSIC, DGUS_LCD_UI_RELOADED, DGUS_LCD_UI_IA_CREALITY)
484+
#if !DGUS_UI_IS(NONE)
470485
#define HAS_DGUS_LCD 1
471486
#endif
472487

Marlin/src/inc/SanityCheck.h

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@
513513
#elif defined(HOME_USING_SPREADCYCLE)
514514
#error "HOME_USING_SPREADCYCLE is now obsolete. Please remove it."
515515
#elif defined(DGUS_LCD)
516-
#error "DGUS_LCD is now DGUS_LCD_UI_(ORIGIN|FYSETC|HIPRECY)."
516+
#error "DGUS_LCD is now DGUS_LCD_UI ORIGIN|FYSETC|HIPRECY)."
517517
#elif defined(DGUS_SERIAL_PORT)
518518
#error "DGUS_SERIAL_PORT is now LCD_SERIAL_PORT."
519519
#elif defined(DGUS_BAUDRATE)
@@ -3009,7 +3009,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
30093009
+ (DISABLED(IS_LEGACY_TFT) && ENABLED(TFT_GENERIC)) \
30103010
+ (ENABLED(IS_LEGACY_TFT) && COUNT_ENABLED(TFT_320x240, TFT_320x240_SPI, TFT_480x320, TFT_480x320_SPI)) \
30113011
+ COUNT_ENABLED(ANYCUBIC_LCD_I3MEGA, ANYCUBIC_LCD_CHIRON, ANYCUBIC_TFT35) \
3012-
+ COUNT_ENABLED(DGUS_LCD_UI_ORIGIN, DGUS_LCD_UI_FYSETC, DGUS_LCD_UI_HIPRECY, DGUS_LCD_UI_MKS, DGUS_LCD_UI_RELOADED) \
3012+
+ DGUS_UI_IS(ORIGIN) + DGUS_UI_IS(FYSETC) + DGUS_UI_IS(HIPRECY) + DGUS_UI_IS(MKS) + DGUS_UI_IS(RELOADED) + DGUS_UI_IS(IA_CREALITY) \
30133013
+ COUNT_ENABLED(ENDER2_STOCKDISPLAY, CR10_STOCKDISPLAY) \
30143014
+ COUNT_ENABLED(DWIN_CREALITY_LCD, DWIN_LCD_PROUI, DWIN_CREALITY_LCD_JYERSUI, DWIN_MARLINUI_PORTRAIT, DWIN_MARLINUI_LANDSCAPE) \
30153015
+ COUNT_ENABLED(FYSETC_MINI_12864_X_X, FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0, FYSETC_GENERIC_12864_1_1) \
@@ -4270,48 +4270,48 @@ static_assert(_PLUS_TEST(4), "HOMING_FEEDRATE_MM_M values must be positive.");
42704270
#undef _BAD_DRIVER
42714271

42724272
/**
4273-
* Require certain features for DGUS_LCD_UI_RELOADED.
4273+
* Require certain features for DGUS_LCD_UI RELOADED.
42744274
*/
4275-
#if ENABLED(DGUS_LCD_UI_RELOADED)
4275+
#if DGUS_UI_IS(RELOADED)
42764276
#if BUFSIZE < 4
4277-
#error "DGUS_LCD_UI_RELOADED requires a BUFSIZE of at least 4."
4277+
#error "DGUS_LCD_UI RELOADED requires a BUFSIZE of at least 4."
42784278
#elif HOTENDS < 1
4279-
#error "DGUS_LCD_UI_RELOADED requires at least 1 hotend."
4279+
#error "DGUS_LCD_UI RELOADED requires at least 1 hotend."
42804280
#elif EXTRUDERS < 1
4281-
#error "DGUS_LCD_UI_RELOADED requires at least 1 extruder."
4281+
#error "DGUS_LCD_UI RELOADED requires at least 1 extruder."
42824282
#elif !HAS_HEATED_BED
4283-
#error "DGUS_LCD_UI_RELOADED requires a heated bed."
4283+
#error "DGUS_LCD_UI RELOADED requires a heated bed."
42844284
#elif FAN_COUNT < 1
4285-
#error "DGUS_LCD_UI_RELOADED requires a fan."
4285+
#error "DGUS_LCD_UI RELOADED requires a fan."
42864286
#elif !HAS_BED_PROBE
4287-
#error "DGUS_LCD_UI_RELOADED requires a bed probe."
4287+
#error "DGUS_LCD_UI RELOADED requires a bed probe."
42884288
#elif !HAS_MESH
4289-
#error "DGUS_LCD_UI_RELOADED requires mesh leveling."
4289+
#error "DGUS_LCD_UI RELOADED requires mesh leveling."
42904290
#elif DISABLED(LCD_BED_TRAMMING)
4291-
#error "DGUS_LCD_UI_RELOADED requires LCD_BED_TRAMMING."
4291+
#error "DGUS_LCD_UI RELOADED requires LCD_BED_TRAMMING."
42924292
#elif DISABLED(BABYSTEP_ALWAYS_AVAILABLE)
4293-
#error "DGUS_LCD_UI_RELOADED requires BABYSTEP_ALWAYS_AVAILABLE."
4293+
#error "DGUS_LCD_UI RELOADED requires BABYSTEP_ALWAYS_AVAILABLE."
42944294
#elif DISABLED(BABYSTEP_ZPROBE_OFFSET)
4295-
#error "DGUS_LCD_UI_RELOADED requires BABYSTEP_ZPROBE_OFFSET."
4295+
#error "DGUS_LCD_UI RELOADED requires BABYSTEP_ZPROBE_OFFSET."
42964296
#elif ENABLED(AUTO_BED_LEVELING_UBL) && DISABLED(UBL_SAVE_ACTIVE_ON_M500)
42974297
#warning "Without UBL_SAVE_ACTIVE_ON_M500, your mesh will not be saved when using the touchscreen."
42984298
#endif
42994299
#endif
43004300

43014301
/**
4302-
* Require certain features for DGUS_LCD_UI_IA_CREALITY.
4302+
* Require certain features for DGUS_LCD_UI IA_CREALITY.
43034303
*/
4304-
#if ENABLED(DGUS_LCD_UI_IA_CREALITY)
4304+
#if DGUS_UI_IS(IA_CREALITY)
43054305
#if DISABLED(ADVANCED_PAUSE_FEATURE)
4306-
#error "DGUS_LCD_UI_IA_CREALITY requires ADVANCED_PAUSE_FEATURE."
4306+
#error "DGUS_LCD_UI IA_CREALITY requires ADVANCED_PAUSE_FEATURE."
43074307
#elif DISABLED(LCD_BED_TRAMMING)
4308-
#error "DGUS_LCD_UI_IA_CREALITY requires LCD_BED_TRAMMING."
4308+
#error "DGUS_LCD_UI IA_CREALITY requires LCD_BED_TRAMMING."
43094309
#elif DISABLED(CLASSIC_JERK)
4310-
#error "DGUS_LCD_UI_IA_CREALITY requires CLASSIC_JERK."
4310+
#error "DGUS_LCD_UI IA_CREALITY requires CLASSIC_JERK."
43114311
#elif DISABLED(BABYSTEPPING)
4312-
#error "DGUS_LCD_UI_IA_CREALITY requires BABYSTEPPING."
4313-
#elif NONE(AUTO_BED_LEVELING_BILINEAR,AUTO_BED_LEVELING_UBL,MESH_BED_LEVELING)
4314-
#error "DGUS_LCD_UI_IA_CREALITY requires AUTO_BED_LEVELING_BILINEAR or AUTO_BED_LEVELING_UBL or MESH_BED_LEVELING)."
4312+
#error "DGUS_LCD_UI IA_CREALITY requires BABYSTEPPING."
4313+
#elif NONE(AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_UBL, MESH_BED_LEVELING)
4314+
#error "DGUS_LCD_UI IA_CREALITY requires AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_UBL, or MESH_BED_LEVELING."
43154315
#endif
43164316
#endif
43174317

0 commit comments

Comments
 (0)