Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Mar 29, 2022
1 parent d981c63 commit cdb4f57
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 19 deletions.
1 change: 0 additions & 1 deletion Marlin/src/lcd/e3v2/common/dwin_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ bool DWIN_Handshake() {
}
#endif


// Get font character width
uint8_t fontWidth(uint8_t cfont) {
switch (cfont) {
Expand Down
31 changes: 13 additions & 18 deletions Marlin/src/lcd/e3v2/marlinui/ui_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,35 +96,30 @@ void MarlinUI::clear_lcd() {
void MarlinUI::show_bootscreen() {
dwin_string.set(F(SHORT_BUILD_VERSION));

#if ENABLED(SHOW_CUSTOM_BOOTSCREEN)
#ifndef CUSTOM_BOOTSCREEN_TIMEOUT
#define CUSTOM_BOOTSCREEN_TIMEOUT 3000
#endif
#if ENABLED(SHOW_CUSTOM_BOOTSCREEN) && !defined(CUSTOM_BOOTSCREEN_TIMEOUT)
#define CUSTOM_BOOTSCREEN_TIMEOUT 3000
#endif

#if ENABLED(DWIN_MARLINUI_PORTRAIT)
#define LOGO_CENTER ((LCD_PIXEL_WIDTH) / 2)
#define INFO_CENTER LOGO_CENTER
#define VERSION_Y 330
DWIN_Draw_String(false, font10x20, Color_Yellow, Color_Bg_Black, INFO_CENTER - (dwin_string.length() * 10) / 2, VERSION_Y, S(dwin_string.string()));
#if ENABLED(SHOW_CUSTOM_BOOTSCREEN)
safe_delay(CUSTOM_BOOTSCREEN_TIMEOUT);
#endif
clear_lcd();
DWIN_ICON_Show(BOOT_ICON, ICON_MarlinBoot, LOGO_CENTER - 266 / 2, 15);
#else
#define LOGO_CENTER (280 / 2)
#define INFO_CENTER ((LCD_PIXEL_WIDTH) - 200 / 2)
#define VERSION_Y 84
#endif

DWIN_Draw_String(false, font10x20, Color_Yellow, Color_Bg_Black, INFO_CENTER - (dwin_string.length() * 10) / 2, VERSION_Y, S(dwin_string.string()));
TERN_(SHOW_CUSTOM_BOOTSCREEN, safe_delay(CUSTOM_BOOTSCREEN_TIMEOUT));
clear_lcd();
DWIN_ICON_Show(BOOT_ICON, ICON_MarlinBoot, LOGO_CENTER - 266 / 2, 15);
#if ENABLED(DWIN_MARLINUI_PORTRAIT)
DWIN_ICON_Show(BOOT_ICON, ICON_OpenSource, LOGO_CENTER - 174 / 2, 280);
DWIN_ICON_Show(BOOT_ICON, ICON_GitHubURL, LOGO_CENTER - 180 / 2, 420);
DWIN_ICON_Show(BOOT_ICON, ICON_MarlinURL, LOGO_CENTER - 100 / 2, 440);
DWIN_ICON_Show(BOOT_ICON, ICON_Copyright, LOGO_CENTER - 126 / 2, 460);
#else
#define LOGO_CENTER (280 / 2)
#define INFO_CENTER ((LCD_PIXEL_WIDTH) - 200 / 2)
#define VERSION_Y 84
DWIN_Draw_String(false, font10x20, Color_Yellow, Color_Bg_Black, INFO_CENTER - (dwin_string.length() * 10) / 2, VERSION_Y, S(dwin_string.string()));
#if ENABLED(SHOW_CUSTOM_BOOTSCREEN)
safe_delay(CUSTOM_BOOTSCREEN_TIMEOUT);
#endif
clear_lcd();
DWIN_ICON_Show(BOOT_ICON, ICON_MarlinBoot, LOGO_CENTER - 266 / 2, 15);
DWIN_ICON_Show(BOOT_ICON, ICON_OpenSource, INFO_CENTER - 174 / 2, 60);
DWIN_ICON_Show(BOOT_ICON, ICON_GitHubURL, INFO_CENTER - 180 / 2, 130);
Expand Down

0 comments on commit cdb4f57

Please sign in to comment.