Move last bootscreen delay to end of setup (#21665)

This commit is contained in:
Scott Lahteine
2021-04-24 01:29:30 -05:00
committed by GitHub
parent a73dce4a56
commit a29aefc9c0
9 changed files with 57 additions and 12 deletions

View File

@ -486,7 +486,9 @@ void MarlinUI::clear_lcd() { lcd.clear(); }
CENTER_OR_SCROLL(STRING_SPLASH_LINE3, 1500);
#endif
}
}
void MarlinUI::bootscreen_completion(const millis_t) {
lcd.clear();
safe_delay(100);
set_custom_characters(CHARSET_INFO);

View File

@ -397,7 +397,10 @@ static void center_text_P(PGM_P pstart, uint8_t y) {
center_text_P(PSTR(MARLIN_WEBSITE_URL), 4);
picBits = ICON_LOGO;
lcd.print_screen();
safe_delay(1500);
}
void MarlinUI::bootscreen_completion(const millis_t sofar) {
if ((BOOTSCREEN_TIMEOUT) > sofar) safe_delay((BOOTSCREEN_TIMEOUT) - sofar);
}
#endif // SHOW_BOOTSCREEN

View File

@ -160,20 +160,21 @@ bool MarlinUI::detected() { return true; }
#endif
u8g.firstPage();
do { draw_custom_bootscreen(f); } while (u8g.nextPage());
if (frame_time) safe_delay(frame_time);
if (frame_time) early_safe_delay(frame_time);
}
#ifndef CUSTOM_BOOTSCREEN_TIMEOUT
#define CUSTOM_BOOTSCREEN_TIMEOUT 2500
#endif
#if CUSTOM_BOOTSCREEN_TIMEOUT
safe_delay(CUSTOM_BOOTSCREEN_TIMEOUT);
early_safe_delay(CUSTOM_BOOTSCREEN_TIMEOUT);
#endif
}
#endif // SHOW_CUSTOM_BOOTSCREEN
// Two-part needed to display all info
constexpr bool two_part = ((LCD_PIXEL_HEIGHT) - (START_BMPHEIGHT)) < ((MENU_FONT_ASCENT) * 2);
constexpr uint8_t bootscreen_pages = 1 + two_part;
// Draw the static Marlin bootscreen from a u8g loop
// or the animated boot screen within its own u8g loop
@ -225,17 +226,16 @@ bool MarlinUI::detected() { return true; }
constexpr millis_t frame_time = MARLIN_BOOTSCREEN_FRAME_TIME;
LOOP_L_N(f, COUNT(marlin_bootscreen_animation)) {
draw_bootscreen_bmp((uint8_t*)pgm_read_ptr(&marlin_bootscreen_animation[f]));
if (frame_time) safe_delay(frame_time);
if (frame_time) early_safe_delay(frame_time);
}
#endif
}
// Show the Marlin bootscreen, with the u8g loop and delays
void MarlinUI::show_marlin_bootscreen() {
constexpr uint8_t pages = two_part ? 2 : 1;
for (uint8_t q = pages; q--;) {
for (uint8_t q = bootscreen_pages; q--;) {
draw_marlin_bootscreen(q == 0);
safe_delay((BOOTSCREEN_TIMEOUT) / pages);
if (q) early_safe_delay((BOOTSCREEN_TIMEOUT) / bootscreen_pages);
}
}
@ -244,6 +244,10 @@ bool MarlinUI::detected() { return true; }
show_marlin_bootscreen();
}
void MarlinUI::bootscreen_completion(const millis_t sofar) {
if ((BOOTSCREEN_TIMEOUT) / bootscreen_pages > sofar) safe_delay((BOOTSCREEN_TIMEOUT) / bootscreen_pages - sofar);
}
#endif // SHOW_BOOTSCREEN
#if ENABLED(LIGHTWEIGHT_UI)

View File

@ -337,6 +337,7 @@ public:
static void draw_marlin_bootscreen(const bool line2=false);
static void show_marlin_bootscreen();
static void show_bootscreen();
static void bootscreen_completion(const millis_t sofar);
#endif
#if HAS_MARLINUI_U8GLIB

View File

@ -60,6 +60,7 @@ void MarlinUI::tft_idle() {
}
#if ENABLED(SHOW_BOOTSCREEN)
void MarlinUI::show_bootscreen() {
tft.queue.reset();
@ -81,9 +82,13 @@ void MarlinUI::tft_idle() {
#endif
tft.queue.sync();
safe_delay(BOOTSCREEN_TIMEOUT);
}
void MarlinUI::bootscreen_completion(const millis_t sofar) {
if ((BOOTSCREEN_TIMEOUT) > sofar) safe_delay((BOOTSCREEN_TIMEOUT) - sofar);
clear_lcd();
}
#endif
void MarlinUI::draw_kill_screen() {

View File

@ -60,6 +60,7 @@ void MarlinUI::tft_idle() {
}
#if ENABLED(SHOW_BOOTSCREEN)
void MarlinUI::show_bootscreen() {
tft.queue.reset();
@ -81,9 +82,13 @@ void MarlinUI::tft_idle() {
#endif
tft.queue.sync();
safe_delay(BOOTSCREEN_TIMEOUT);
}
void MarlinUI::bootscreen_completion(const millis_t sofar) {
if ((BOOTSCREEN_TIMEOUT) > sofar) safe_delay((BOOTSCREEN_TIMEOUT) - sofar);
clear_lcd();
}
#endif
void MarlinUI::draw_kill_screen() {