Skip to content

Commit

Permalink
Revert "Invariant Marlin bootscreen (MarlinFirmware#15057)"
Browse files Browse the repository at this point in the history
This reverts commit 3ac76f0.
  • Loading branch information
ManuelMcLure committed Sep 4, 2019
1 parent 75efa3c commit 5260b95
Show file tree
Hide file tree
Showing 127 changed files with 1,050 additions and 780 deletions.
9 changes: 7 additions & 2 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,13 @@

// @section info

// Author info of this build printed to the host during boot and M115
// User-specified version info of this build to display in [Pronterface, etc] terminal window during
// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this
// build by the user have been successfully uploaded into firmware.
#define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes.
#define SHOW_BOOTSCREEN
#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1
#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2

/**
* *** VENDORS PLEASE READ ***
Expand All @@ -90,7 +95,7 @@
// Show the bitmap in Marlin/_Bootscreen.h on startup.
//#define SHOW_CUSTOM_BOOTSCREEN

// Show the bitmap in Marlin/_Statusscreen.h on the status screen.
// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen.
//#define CUSTOM_STATUS_SCREEN_IMAGE

// @section machine
Expand Down
2 changes: 0 additions & 2 deletions Marlin/src/inc/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -386,8 +386,6 @@
#error "MKS_ROBIN_TFT is now FSMC_GRAPHICAL_TFT. Please update your configuration."
#elif defined(SDPOWER)
#error "SDPOWER is now SDPOWER_PIN. Please update your configuration and/or pins."
#elif defined(STRING_SPLASH_LINE1) || defined(STRING_SPLASH_LINE2)
#error "STRING_SPLASH_LINE[12] are now obsolete. Please remove them from Configuration.h."
#endif

#define BOARD_MKS_13 -1000
Expand Down
77 changes: 53 additions & 24 deletions Marlin/src/lcd/HD44780/ultralcd_HD44780.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -449,28 +449,59 @@ void MarlinUI::clear_lcd() { lcd.clear(); }
lcd_scroll(0, 3, PSTR(STRING), LCD_WIDTH, DELAY); \
}

//
// Show the Marlin logo with splash line 1
//
if (LCD_EXTRA_SPACE >= utf8_strlen(SHORT_BUILD_VERSION) + 1) {
#ifdef STRING_SPLASH_LINE1
//
// Show the Marlin logo, splash line1, and splash line 2
// Show the Marlin logo with splash line 1
//
logo_lines(PSTR(" " SHORT_BUILD_VERSION));
CENTER_OR_SCROLL(MARLIN_WEBSITE_URL, 2000);
}
else {
if (LCD_EXTRA_SPACE >= utf8_strlen(STRING_SPLASH_LINE1) + 1) {
//
// Show the Marlin logo, splash line1, and splash line 2
//
logo_lines(PSTR(" " STRING_SPLASH_LINE1));
#ifdef STRING_SPLASH_LINE2
CENTER_OR_SCROLL(STRING_SPLASH_LINE2, 2000);
#else
safe_delay(2000);
#endif
}
else {
//
// Show the Marlin logo with splash line 1
// After a delay show splash line 2, if it exists
//
#ifdef STRING_SPLASH_LINE2
#define _SPLASH_WAIT_1 1500
#else
#define _SPLASH_WAIT_1 2000
#endif
logo_lines(PSTR(""));
CENTER_OR_SCROLL(STRING_SPLASH_LINE1, _SPLASH_WAIT_1);
#ifdef STRING_SPLASH_LINE2
CENTER_OR_SCROLL(STRING_SPLASH_LINE2, 1500);
#ifdef STRING_SPLASH_LINE3
CENTER_OR_SCROLL(STRING_SPLASH_LINE3, 1500);
#endif
#endif
}
#elif defined(STRING_SPLASH_LINE2)
//
// Show the Marlin logo and short build version
// After a delay show the website URL
// Show splash line 2 only, alongside the logo if possible
//
if (LCD_EXTRA_SPACE >= utf8_strlen(STRING_SPLASH_LINE2) + 1) {
logo_lines(PSTR(" " STRING_SPLASH_LINE2));
safe_delay(2000);
}
else {
logo_lines(PSTR(""));
CENTER_OR_SCROLL(STRING_SPLASH_LINE2, 2000);
}
#else
//
// Show only the Marlin logo
//
logo_lines(PSTR(""));
CENTER_OR_SCROLL(SHORT_BUILD_VERSION, 1500);
CENTER_OR_SCROLL(MARLIN_WEBSITE_URL, 1500);
#ifdef STRING_SPLASH_LINE3
CENTER_OR_SCROLL(STRING_SPLASH_LINE3, 1500);
#endif
}
safe_delay(2000);
#endif

lcd.clear();
safe_delay(100);
Expand Down Expand Up @@ -554,13 +585,11 @@ FORCE_INLINE void _draw_heater_status(const heater_ind_t heater, const char pref

FORCE_INLINE void _draw_bed_status(const bool blink) {
_draw_heater_status(H_BED, (
#if HAS_LEVELING
planner.leveling_active && blink ? '_' :
#endif
LCD_STR_BEDTEMP[0]
),
blink
);
#if HAS_LEVELING
planner.leveling_active && blink ? '_' :
#endif
LCD_STR_BEDTEMP[0]
), blink);
}

#if HAS_PRINT_PROGRESS
Expand Down
44 changes: 24 additions & 20 deletions Marlin/src/lcd/dogm/ultralcd_DOGM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,17 +159,23 @@ bool MarlinUI::detected() { return true; }
}
#endif // SHOW_CUSTOM_BOOTSCREEN

// Draw the static Marlin bootscreen from a u8g loop
// or the animated boot screen within its own u8g loop
void MarlinUI::draw_marlin_bootscreen(const bool line2/*=false*/) {
// Draws a slice of the Marlin bootscreen, without the u8g loop
void MarlinUI::draw_marlin_bootscreen() {
// Screen dimensions.
//const u8g_uint_t width = u8g.getWidth(), height = u8g.getHeight();
constexpr u8g_uint_t width = LCD_PIXEL_WIDTH, height = LCD_PIXEL_HEIGHT;

// Determine text space needed
constexpr u8g_uint_t text_width_1 = u8g_uint_t((sizeof(SHORT_BUILD_VERSION) - 1) * (MENU_FONT_WIDTH)),
text_width_2 = u8g_uint_t((sizeof(MARLIN_WEBSITE_URL) - 1) * (MENU_FONT_WIDTH)),
#ifndef STRING_SPLASH_LINE2
constexpr u8g_uint_t text_total_height = MENU_FONT_HEIGHT,
text_width_2 = 0;
#else
constexpr u8g_uint_t text_total_height = (MENU_FONT_HEIGHT) * 2,
text_width_2 = u8g_uint_t((sizeof(STRING_SPLASH_LINE2) - 1) * (MENU_FONT_WIDTH));
#endif
constexpr u8g_uint_t text_width_1 = u8g_uint_t((sizeof(STRING_SPLASH_LINE1) - 1) * (MENU_FONT_WIDTH)),
text_max_width = _MAX(text_width_1, text_width_2),
text_total_height = (MENU_FONT_HEIGHT) * 2,
width = LCD_PIXEL_WIDTH, height = LCD_PIXEL_HEIGHT,
rspace = width - (START_BMPWIDTH);
constexpr bool two_part = (height - (START_BMPHEIGHT)) < ((MENU_FONT_ASCENT) * 2);

u8g_int_t offx, offy, txt_base, txt_offx_1, txt_offx_2;

Expand All @@ -183,8 +189,8 @@ bool MarlinUI::detected() { return true; }
}
else {
constexpr int8_t inter = (height - text_total_height - (START_BMPHEIGHT)) / 3; // Evenly distribute vertical space
offx = rspace / 2; // Center the boot logo in the whole space
offy = inter; // V-align boot logo proportionally
offx = rspace / 2; // Center the boot logo in the whole space
txt_offx_1 = (width - text_width_1) / 2; // Text 1 centered
txt_offx_2 = (width - text_width_2) / 2; // Text 2 centered
txt_base = offy + START_BMPHEIGHT + offy + text_total_height - (MENU_FONT_DESCENT); // Even spacing looks best
Expand All @@ -195,8 +201,12 @@ bool MarlinUI::detected() { return true; }
auto draw_bootscreen_bmp = [&](const uint8_t *bitmap) {
u8g.drawBitmapP(offx, offy, START_BMP_BYTEWIDTH, START_BMPHEIGHT, bitmap);
set_font(FONT_MENU);
if (!two_part || !line2) lcd_put_u8str_P(txt_offx_1, txt_base - (MENU_FONT_HEIGHT), PSTR(SHORT_BUILD_VERSION));
if (!two_part || line2) lcd_put_u8str_P(txt_offx_2, txt_base, PSTR(MARLIN_WEBSITE_URL));
#ifndef STRING_SPLASH_LINE2
lcd_put_u8str_P(txt_offx_1, txt_base, PSTR(STRING_SPLASH_LINE1));
#else
lcd_put_u8str_P(txt_offx_1, txt_base - (MENU_FONT_HEIGHT), PSTR(STRING_SPLASH_LINE1));
lcd_put_u8str_P(txt_offx_2, txt_base, PSTR(STRING_SPLASH_LINE2));
#endif
};

#if DISABLED(BOOT_MARLIN_LOGO_ANIMATED)
Expand All @@ -219,15 +229,9 @@ bool MarlinUI::detected() { return true; }
#ifndef BOOTSCREEN_TIMEOUT
#define BOOTSCREEN_TIMEOUT 2500
#endif
for (uint8_t q = 2; q--;) {
#if DISABLED(BOOT_MARLIN_LOGO_ANIMATED)
u8g.firstPage();
do { draw_marlin_bootscreen(q == 0); } while (u8g.nextPage());
#else
draw_marlin_bootscreen(q == 0);
#endif
safe_delay((BOOTSCREEN_TIMEOUT) / 2);
}
u8g.firstPage();
do { draw_marlin_bootscreen(); } while (u8g.nextPage());
safe_delay(BOOTSCREEN_TIMEOUT);
}

void MarlinUI::show_bootscreen() {
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/ultralcd.h
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ class MarlinUI {
#endif

#if ENABLED(SHOW_BOOTSCREEN)
static void draw_marlin_bootscreen(const bool line2=false);
static void draw_marlin_bootscreen();
static void show_marlin_bootscreen();
static void show_bootscreen();
#endif
Expand Down
14 changes: 8 additions & 6 deletions config/default/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,13 @@

// @section info

// Author info of this build printed to the host during boot and M115
// User-specified version info of this build to display in [Pronterface, etc] terminal window during
// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this
// build by the user have been successfully uploaded into firmware.
#define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes.
#define SHOW_BOOTSCREEN
#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1
#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2

/**
* *** VENDORS PLEASE READ ***
Expand All @@ -84,13 +89,10 @@
* respectfully request that you retain the unmodified Marlin boot screen.
*/

// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION **
#define SHOW_BOOTSCREEN

// Show the bitmap in Marlin/_Bootscreen.h on startup.
// Enable to show the bitmap in Marlin/_Bootscreen.h on startup.
//#define SHOW_CUSTOM_BOOTSCREEN

// Show the bitmap in Marlin/_Statusscreen.h on the status screen.
// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen.
//#define CUSTOM_STATUS_SCREEN_IMAGE

// @section machine
Expand Down
14 changes: 8 additions & 6 deletions config/examples/3DFabXYZ/Migbot/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,13 @@

// @section info

// Author info of this build printed to the host during boot and M115
// User-specified version info of this build to display in [Pronterface, etc] terminal window during
// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this
// build by the user have been successfully uploaded into firmware.
#define STRING_CONFIG_H_AUTHOR "AJMartel" // Who made the changes.
#define SHOW_BOOTSCREEN
#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1
#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2

/**
* *** VENDORS PLEASE READ ***
Expand All @@ -84,13 +89,10 @@
* respectfully request that you retain the unmodified Marlin boot screen.
*/

// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION **
#define SHOW_BOOTSCREEN

// Show the bitmap in Marlin/_Bootscreen.h on startup.
// Enable to show the bitmap in Marlin/_Bootscreen.h on startup.
//#define SHOW_CUSTOM_BOOTSCREEN

// Show the bitmap in Marlin/_Statusscreen.h on the status screen.
// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen.
//#define CUSTOM_STATUS_SCREEN_IMAGE

// @section machine
Expand Down
7 changes: 2 additions & 5 deletions config/examples/ADIMLab/Gantry v1/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,10 @@
* respectfully request that you retain the unmodified Marlin boot screen.
*/

// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION **
#define SHOW_BOOTSCREEN

// Show the bitmap in Marlin/_Bootscreen.h on startup.
// Enable to show the bitmap in Marlin/_Bootscreen.h on startup.
#define SHOW_CUSTOM_BOOTSCREEN

// Show the bitmap in Marlin/_Statusscreen.h on the status screen.
// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen.
//#define CUSTOM_STATUS_SCREEN_IMAGE

// @section machine
Expand Down
7 changes: 2 additions & 5 deletions config/examples/ADIMLab/Gantry v2/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,10 @@
* respectfully request that you retain the unmodified Marlin boot screen.
*/

// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION **
#define SHOW_BOOTSCREEN

// Show the bitmap in Marlin/_Bootscreen.h on startup.
// Enable to show the bitmap in Marlin/_Bootscreen.h on startup.
#define SHOW_CUSTOM_BOOTSCREEN

// Show the bitmap in Marlin/_Statusscreen.h on the status screen.
// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen.
//#define CUSTOM_STATUS_SCREEN_IMAGE

// @section machine
Expand Down
14 changes: 8 additions & 6 deletions config/examples/AlephObjects/TAZ4/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,13 @@

// @section info

// Author info of this build printed to the host during boot and M115
// User-specified version info of this build to display in [Pronterface, etc] terminal window during
// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this
// build by the user have been successfully uploaded into firmware.
#define STRING_CONFIG_H_AUTHOR "(Aleph Objects Inc, TAZ)" // Who made the changes.
#define SHOW_BOOTSCREEN
#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1
#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2

/**
* *** VENDORS PLEASE READ ***
Expand All @@ -84,13 +89,10 @@
* respectfully request that you retain the unmodified Marlin boot screen.
*/

// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION **
#define SHOW_BOOTSCREEN

// Show the bitmap in Marlin/_Bootscreen.h on startup.
// Enable to show the bitmap in Marlin/_Bootscreen.h on startup.
//#define SHOW_CUSTOM_BOOTSCREEN

// Show the bitmap in Marlin/_Statusscreen.h on the status screen.
// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen.
//#define CUSTOM_STATUS_SCREEN_IMAGE

// @section machine
Expand Down
14 changes: 8 additions & 6 deletions config/examples/Alfawise/U20/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,13 @@

// @section info

// Author info of this build printed to the host during boot and M115
// User-specified version info of this build to display in [Pronterface, etc] terminal window during
// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this
// build by the user have been successfully uploaded into firmware.
#define STRING_CONFIG_H_AUTHOR "Hobi, tpruvot" // Who made the changes.
#define SHOW_BOOTSCREEN
#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1
#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2

/**
* *** VENDORS PLEASE READ ***
Expand All @@ -109,13 +114,10 @@
* respectfully request that you retain the unmodified Marlin boot screen.
*/

// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION **
#define SHOW_BOOTSCREEN

// Show the bitmap in Marlin/_Bootscreen.h on startup.
// Enable to show the bitmap in Marlin/_Bootscreen.h on startup.
//#define SHOW_CUSTOM_BOOTSCREEN

// Show the bitmap in Marlin/_Statusscreen.h on the status screen.
// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen.
#define CUSTOM_STATUS_SCREEN_IMAGE

// @section machine
Expand Down
Loading

0 comments on commit 5260b95

Please sign in to comment.