Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Jan 1, 2023
1 parent cbf4a73 commit 660751d
Show file tree
Hide file tree
Showing 16 changed files with 2,769 additions and 3,073 deletions.
27 changes: 11 additions & 16 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -2939,23 +2939,16 @@

/**
* DGUS Touch Display with DWIN OS. (Choose one.)
* ORIGIN : https://www.aliexpress.com/item/32993409517.html
* FYSETC : https://www.aliexpress.com/item/32961471929.html
* MKS : https://www.aliexpress.com/item/1005002008179262.html
*
* Flash display with DGUS Displays for Marlin:
* - Format the SD card to FAT32 with an allocation size of 4kb.
* - Download files as specified for your type of display.
* - Plug the microSD card into the back of the display.
* - Boot the display and wait for the update to complete.
*
* ORIGIN (Marlin DWIN_SET)
* - Download https://github.com/coldtobi/Marlin_DGUS_Resources
* - Copy the downloaded DWIN_SET folder to the SD card.
* - Product: https://www.aliexpress.com/item/32993409517.html
*
* FYSETC (Supplier default)
* - Download https://github.com/FYSETC/FYSTLCD-2.0
* - Copy the downloaded SCREEN folder to the SD card.
* - Product: https://www.aliexpress.com/item/32961471929.html
*
* HIPRECY (Supplier default)
* - Download https://github.com/HiPrecy/Touch-Lcd-LEO
Expand All @@ -2964,6 +2957,7 @@
* MKS (MKS-H43) (Supplier default)
* - Download https://github.com/makerbase-mks/MKS-H43
* - Copy the downloaded DWIN_SET folder to the SD card.
* - Product: https://www.aliexpress.com/item/1005002008179262.html
*
* RELOADED (T5UID1)
* - Download https://github.com/Desuuuu/DGUS-reloaded/releases
Expand All @@ -2972,14 +2966,15 @@
* IA_CREALITY (T5UID1)
* - Download https://github.com/InsanityAutomation/Marlin/raw/CrealityDwin2.0_Bleeding/TM3D_Combined480272_Landscape_V7.7z
* - Copy the downloaded DWIN_SET folder to the SD card.
*
* Flash display with DGUS Displays for Marlin:
* - Format the SD card to FAT32 with an allocation size of 4kb.
* - Download files as specified for your type of display.
* - Plug the microSD card into the back of the display.
* - Boot the display and wait for the update to complete.
*/
//#define DGUS_LCD_UI_ORIGIN
//#define DGUS_LCD_UI_FYSETC
//#define DGUS_LCD_UI_HIPRECY
//#define DGUS_LCD_UI_MKS
//#define DGUS_LCD_UI_RELOADED
//#define DGUS_LCD_UI_IA_CREALITY
#if ENABLED(DGUS_LCD_UI_MKS)
//#define DGUS_LCD_UI ORIGIN
#if DGUS_UI_IS(MKS)
#define USE_MKS_GREEN_UI
#endif

Expand Down
4 changes: 2 additions & 2 deletions Marlin/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -1864,11 +1864,11 @@

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

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

#if EITHER(DGUS_LCD_UI_FYSETC, DGUS_LCD_UI_MKS)
#if DGUS_UI_IS(FYSETC, MKS)
//#define DGUS_UI_MOVE_DIS_OPTION // Disabled by default for FYSETC and MKS
#else
#define DGUS_UI_MOVE_DIS_OPTION // Enabled by default for UI_HIPRECY
Expand Down
10 changes: 10 additions & 0 deletions Marlin/src/core/macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -742,3 +742,13 @@
#define _HAS_E_TEMP(N) || TEMP_SENSOR(N)
#define HAS_E_TEMP_SENSOR (0 REPEAT(EXTRUDERS, _HAS_E_TEMP))
#define TEMP_SENSOR_IS_MAX_TC(T) (TEMP_SENSOR(T) == -5 || TEMP_SENSOR(T) == -3 || TEMP_SENSOR(T) == -2)

#define _UI_NONE 0
#define _UI_ORIGIN 101
#define _UI_FYSETC 102
#define _UI_HIPRECY 103
#define _UI_MKS 104
#define _UI_RELOADED 105
#define _UI_IA_CREALITY 106
#define _DGUS_UI_IS(N) || (DGUS_LCD_UI == _UI_ ## N)
#define DGUS_UI_IS(V...) (0 MAP(_DGUS_UI_IS, V))
24 changes: 19 additions & 5 deletions Marlin/src/inc/Conditionals_LCD.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,21 @@
#define FYSETC_MINI_12864_2_1
#endif

// Updated DGUS_UI shorthand single option can be used, or old settings, for now
#if DGUS_UI_IS(ORIGIN)
#define DGUS_LCD_UI_ORIGIN
#elif DGUS_UI_IS(FYSETC)
#define DGUS_LCD_UI_FYSETC
#elif DGUS_UI_IS(HIPRECY)
#define DGUS_LCD_UI_HIPRECY
#elif DGUS_UI_IS(MKS)
#define DGUS_LCD_UI_MKS
#elif DGUS_UI_IS(RELOADED)
#define DGUS_LCD_UI_RELOADED
#elif DGUS_UI_IS(IA_CREALITY)
#define DGUS_LCD_UI_IA_CREALITY
#endif

/**
* General Flags that may be set below by specific LCDs
*
Expand Down Expand Up @@ -462,12 +477,11 @@
#endif

// Aliases for LCD features
#if ANY(DGUS_LCD_UI_ORIGIN, DGUS_LCD_UI_FYSETC, DGUS_LCD_UI_HIPRECY, DGUS_LCD_UI_MKS)
#define HAS_DGUS_LCD_CLASSIC 1
#endif

#if ANY(HAS_DGUS_LCD_CLASSIC, DGUS_LCD_UI_RELOADED, DGUS_LCD_UI_IA_CREALITY)
#if !DGUS_UI_IS(NONE)
#define HAS_DGUS_LCD 1
#if DGUS_UI_IS(ORIGIN, FYSETC, HIPRECY, MKS)
#define HAS_DGUS_LCD_CLASSIC 1
#endif
#endif

// Extensible UI serial touch screens. (See src/lcd/extui)
Expand Down
44 changes: 22 additions & 22 deletions Marlin/src/inc/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@
#elif defined(HOME_USING_SPREADCYCLE)
#error "HOME_USING_SPREADCYCLE is now obsolete. Please remove it."
#elif defined(DGUS_LCD)
#error "DGUS_LCD is now DGUS_LCD_UI_(ORIGIN|FYSETC|HIPRECY)."
#error "DGUS_LCD is now DGUS_LCD_UI ORIGIN|FYSETC|HIPRECY)."
#elif defined(DGUS_SERIAL_PORT)
#error "DGUS_SERIAL_PORT is now LCD_SERIAL_PORT."
#elif defined(DGUS_BAUDRATE)
Expand Down Expand Up @@ -3009,7 +3009,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
+ (DISABLED(IS_LEGACY_TFT) && ENABLED(TFT_GENERIC)) \
+ (ENABLED(IS_LEGACY_TFT) && COUNT_ENABLED(TFT_320x240, TFT_320x240_SPI, TFT_480x320, TFT_480x320_SPI)) \
+ COUNT_ENABLED(ANYCUBIC_LCD_I3MEGA, ANYCUBIC_LCD_CHIRON, ANYCUBIC_TFT35) \
+ COUNT_ENABLED(DGUS_LCD_UI_ORIGIN, DGUS_LCD_UI_FYSETC, DGUS_LCD_UI_HIPRECY, DGUS_LCD_UI_MKS, DGUS_LCD_UI_RELOADED) \
+ 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) \
+ COUNT_ENABLED(ENDER2_STOCKDISPLAY, CR10_STOCKDISPLAY) \
+ COUNT_ENABLED(DWIN_CREALITY_LCD, DWIN_LCD_PROUI, DWIN_CREALITY_LCD_JYERSUI, DWIN_MARLINUI_PORTRAIT, DWIN_MARLINUI_LANDSCAPE) \
+ COUNT_ENABLED(FYSETC_MINI_12864_X_X, FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0, FYSETC_GENERIC_12864_1_1) \
Expand Down Expand Up @@ -4270,48 +4270,48 @@ static_assert(_PLUS_TEST(4), "HOMING_FEEDRATE_MM_M values must be positive.");
#undef _BAD_DRIVER

/**
* Require certain features for DGUS_LCD_UI_RELOADED.
* Require certain features for DGUS_LCD_UI RELOADED.
*/
#if ENABLED(DGUS_LCD_UI_RELOADED)
#if DGUS_UI_IS(RELOADED)
#if BUFSIZE < 4
#error "DGUS_LCD_UI_RELOADED requires a BUFSIZE of at least 4."
#error "DGUS_LCD_UI RELOADED requires a BUFSIZE of at least 4."
#elif HOTENDS < 1
#error "DGUS_LCD_UI_RELOADED requires at least 1 hotend."
#error "DGUS_LCD_UI RELOADED requires at least 1 hotend."
#elif EXTRUDERS < 1
#error "DGUS_LCD_UI_RELOADED requires at least 1 extruder."
#error "DGUS_LCD_UI RELOADED requires at least 1 extruder."
#elif !HAS_HEATED_BED
#error "DGUS_LCD_UI_RELOADED requires a heated bed."
#error "DGUS_LCD_UI RELOADED requires a heated bed."
#elif FAN_COUNT < 1
#error "DGUS_LCD_UI_RELOADED requires a fan."
#error "DGUS_LCD_UI RELOADED requires a fan."
#elif !HAS_BED_PROBE
#error "DGUS_LCD_UI_RELOADED requires a bed probe."
#error "DGUS_LCD_UI RELOADED requires a bed probe."
#elif !HAS_MESH
#error "DGUS_LCD_UI_RELOADED requires mesh leveling."
#error "DGUS_LCD_UI RELOADED requires mesh leveling."
#elif DISABLED(LCD_BED_TRAMMING)
#error "DGUS_LCD_UI_RELOADED requires LCD_BED_TRAMMING."
#error "DGUS_LCD_UI RELOADED requires LCD_BED_TRAMMING."
#elif DISABLED(BABYSTEP_ALWAYS_AVAILABLE)
#error "DGUS_LCD_UI_RELOADED requires BABYSTEP_ALWAYS_AVAILABLE."
#error "DGUS_LCD_UI RELOADED requires BABYSTEP_ALWAYS_AVAILABLE."
#elif DISABLED(BABYSTEP_ZPROBE_OFFSET)
#error "DGUS_LCD_UI_RELOADED requires BABYSTEP_ZPROBE_OFFSET."
#error "DGUS_LCD_UI RELOADED requires BABYSTEP_ZPROBE_OFFSET."
#elif ENABLED(AUTO_BED_LEVELING_UBL) && DISABLED(UBL_SAVE_ACTIVE_ON_M500)
#warning "Without UBL_SAVE_ACTIVE_ON_M500, your mesh will not be saved when using the touchscreen."
#endif
#endif

/**
* Require certain features for DGUS_LCD_UI_IA_CREALITY.
* Require certain features for DGUS_LCD_UI IA_CREALITY.
*/
#if ENABLED(DGUS_LCD_UI_IA_CREALITY)
#if DGUS_UI_IS(IA_CREALITY)
#if DISABLED(ADVANCED_PAUSE_FEATURE)
#error "DGUS_LCD_UI_IA_CREALITY requires ADVANCED_PAUSE_FEATURE."
#error "DGUS_LCD_UI IA_CREALITY requires ADVANCED_PAUSE_FEATURE."
#elif DISABLED(LCD_BED_TRAMMING)
#error "DGUS_LCD_UI_IA_CREALITY requires LCD_BED_TRAMMING."
#error "DGUS_LCD_UI IA_CREALITY requires LCD_BED_TRAMMING."
#elif DISABLED(CLASSIC_JERK)
#error "DGUS_LCD_UI_IA_CREALITY requires CLASSIC_JERK."
#error "DGUS_LCD_UI IA_CREALITY requires CLASSIC_JERK."
#elif DISABLED(BABYSTEPPING)
#error "DGUS_LCD_UI_IA_CREALITY requires BABYSTEPPING."
#elif NONE(AUTO_BED_LEVELING_BILINEAR,AUTO_BED_LEVELING_UBL,MESH_BED_LEVELING)
#error "DGUS_LCD_UI_IA_CREALITY requires AUTO_BED_LEVELING_BILINEAR or AUTO_BED_LEVELING_UBL or MESH_BED_LEVELING)."
#error "DGUS_LCD_UI IA_CREALITY requires BABYSTEPPING."
#elif NONE(AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_UBL, MESH_BED_LEVELING)
#error "DGUS_LCD_UI IA_CREALITY requires AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_UBL, or MESH_BED_LEVELING."
#endif
#endif

Expand Down
Loading

0 comments on commit 660751d

Please sign in to comment.