Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom boot screen feature improvement #4305

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Marlin/Conditionals.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
#define LCD_CONTRAST_MIN 60
#define LCD_CONTRAST_MAX 140
#endif

#if ENABLED(MAKRPANEL) || ENABLED(MINIPANEL)
#define DOGLCD
#define ULTIPANEL
Expand Down Expand Up @@ -269,6 +269,10 @@
#endif
#endif

#ifndef BOOTSCREEN_TIMEOUT
#define BOOTSCREEN_TIMEOUT 2500
#endif

#else // CONFIGURATION_LCD

#define CONDITIONALS_H
Expand Down
18 changes: 17 additions & 1 deletion Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,23 @@
#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 STRING_DISTRIBUTION_DATE // will be shown during bootup in line 2
#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2

//
// *** VENDORS PLEASE READ *****************************************************
//
// Marlin now allow you to have a vendor boot image to be displayed on machine
// start. When SHOW_CUSTOM_BOOTSCREEN is defined Marlin will first show your
// custom boot image and them the default Marlin boot image is shown.
//
// We suggest for you to take advantage of this new feature and keep the Marlin
// boot image unmodified. For an example have a look at the bq Hephestos 2
// example configuration folder.
//
//#define SHOW_CUSTOM_BOOTSCREEN
#if ENABLED(SHOW_BOOTSCREEN) && ENABLED(SHOW_CUSTOM_BOOTSCREEN)
#include "_Bootscreen.h"
#endif

// @section machine

Expand Down
2 changes: 2 additions & 0 deletions Marlin/Marlin.h
Original file line number Diff line number Diff line change
Expand Up @@ -389,4 +389,6 @@ void calculate_volumetric_multipliers();
#endif
#endif

void safe_delay(uint16_t del);

#endif //MARLIN_H
2 changes: 1 addition & 1 deletion Marlin/Marlin_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -946,7 +946,7 @@ void setup() {
lcd_init();
#if ENABLED(SHOW_BOOTSCREEN)
#if ENABLED(DOGLCD)
delay(1000);
safe_delay(BOOTSCREEN_TIMEOUT);
#elif ENABLED(ULTRA_LCD)
bootscreen();
lcd_init();
Expand Down
77 changes: 0 additions & 77 deletions Marlin/dogm_custom_bitmaps.h

This file was deleted.

38 changes: 17 additions & 21 deletions Marlin/dogm_lcd_implementation.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@

#include <U8glib.h>
#include "dogm_bitmaps.h"
#include "dogm_custom_bitmaps.h"


#include "ultralcd.h"
#include "ultralcd_st7920_u8glib_rrd.h"
Expand Down Expand Up @@ -220,10 +218,6 @@ char lcd_printPGM(const char* str) {
return n;
}

#if ENABLED(SHOW_BOOTSCREEN)
static bool show_bootscreen = true;
#endif

/* Warning: This function is called from interrupt context */
static void lcd_implementation_init() {

Expand All @@ -241,11 +235,6 @@ static void lcd_implementation_init() {
u8g.setContrast(lcd_contrast);
#endif

// FIXME: remove this workaround
// Uncomment this if you have the first generation (V1.10) of STBs board
// pinMode(17, OUTPUT); // Enable LCD backlight
// digitalWrite(17, HIGH);

#if ENABLED(LCD_SCREEN_ROT_90)
u8g.setRot90(); // Rotate screen by 90°
#elif ENABLED(LCD_SCREEN_ROT_180)
Expand All @@ -255,16 +244,23 @@ static void lcd_implementation_init() {
#endif

#if ENABLED(SHOW_BOOTSCREEN)
#if ENABLED(CUSTOM_START_BMP)
static bool show_bootscreen = true;

#if ENABLED(SHOW_CUSTOM_BOOTSCREEN)
if (show_bootscreen) {
u8g.firstPage();
do {
u8g.drawBitmapP((128-(CUSTOM_START_BMPWIDTH))/2, (64 - (CUSTOM_START_BMPHEIGHT))/2, CUSTOM_START_BMPBYTEWIDTH, CUSTOM_START_BMPHEIGHT, custom_start_bmp);
u8g.drawBitmapP(
(128 - (CUSTOM_BOOTSCREEN_BMPWIDTH)) /2,
( 64 - (CUSTOM_BOOTSCREEN_BMPHEIGHT)) /2,
CEILING(CUSTOM_BOOTSCREEN_BMPWIDTH, 8), CUSTOM_BOOTSCREEN_BMPHEIGHT, custom_start_bmp);
} while (u8g.nextPage());
delay(CUSTOM_START_BMP_DELAY);
safe_delay(CUSTOM_BOOTSCREEN_TIMEOUT);
}
#endif
#endif // SHOW_CUSTOM_BOOTSCREEN

int offx = (u8g.getWidth() - (START_BMPWIDTH)) / 2;

#if ENABLED(START_BMPHIGH)
int offy = 0;
#else
Expand All @@ -273,9 +269,9 @@ static void lcd_implementation_init() {

int txt1X = (u8g.getWidth() - (sizeof(STRING_SPLASH_LINE1) - 1) * (DOG_CHAR_WIDTH)) / 2;

u8g.firstPage();
do {
if (show_bootscreen) {
if (show_bootscreen) {
u8g.firstPage();
do {
u8g.drawBitmapP(offx, offy, START_BMPBYTEWIDTH, START_BMPHEIGHT, start_bmp);
lcd_setFont(FONT_MENU);
#ifndef STRING_SPLASH_LINE2
Expand All @@ -285,12 +281,12 @@ static void lcd_implementation_init() {
u8g.drawStr(txt1X, u8g.getHeight() - (DOG_CHAR_HEIGHT) * 3 / 2, STRING_SPLASH_LINE1);
u8g.drawStr(txt2X, u8g.getHeight() - (DOG_CHAR_HEIGHT) * 1 / 2, STRING_SPLASH_LINE2);
#endif
}
} while (u8g.nextPage());
} while (u8g.nextPage());
}

show_bootscreen = false;

#endif
#endif // SHOW_BOOTSCREEN
}

void lcd_kill_screen() {
Expand Down
20 changes: 18 additions & 2 deletions Marlin/example_configurations/Cartesio/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,24 @@
// build by the user have been successfully uploaded into firmware.
#define STRING_CONFIG_H_AUTHOR "(MaukCC, CartesioE)" // Who made the changes.
#define SHOW_BOOTSCREEN
#define STRING_SPLASH_LINE1 "Cartesio" // will be shown during bootup in line1
#define STRING_SPLASH_LINE2 "Marlin " SHORT_BUILD_VERSION // will be shown during bootup in line 2
#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during boot in line 1
#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during boot in line 2

//
// *** VENDORS PLEASE READ *****************************************************
//
// Marlin now allow you to have a vendor boot image to be displayed on machine
// start. When SHOW_CUSTOM_BOOTSCREEN is defined Marlin will first show your
// custom boot image and them the default Marlin boot image is shown.
//
// We suggest for you to take advantage of this new feature and keep the Marlin
// boot image unmodified. For an example have a look at the bq Hephestos 2
// example configuration folder.
//
#define SHOW_CUSTOM_BOOTSCREEN
#if ENABLED(SHOW_BOOTSCREEN) && ENABLED(SHOW_CUSTOM_BOOTSCREEN)
#include "_Bootscreen.h"
#endif

// @section machine

Expand Down
95 changes: 95 additions & 0 deletions Marlin/example_configurations/Cartesio/_Bootscreen.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
/**
* Marlin 3D Printer Firmware
* Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include <avr/pgmspace.h>

#if ENABLED(SHOW_BOOTSCREEN) && ENABLED(SHOW_CUSTOM_BOOTSCREEN)
#define CUSTOM_BOOTSCREEN_TIMEOUT 2500
#define CUSTOM_BOOTSCREEN_BMPWIDTH 63
#define CUSTOM_BOOTSCREEN_BMPHEIGHT 64

const unsigned char 81x0i84fkcmoqbu7vte29[512] PROGMEM = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x07, 0xc0, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x3f, 0xfc, 0x00, 0x00, 0x00,
0x00, 0x00, 0x03, 0xff, 0xff, 0xc0, 0x00, 0x00,
0x00, 0x00, 0x1f, 0xff, 0xff, 0xf0, 0x00, 0x00,
0x00, 0x00, 0x7f, 0xff, 0xff, 0xfc, 0x00, 0x00,
0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00,
0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x00,
0x00, 0x00, 0x00, 0x07, 0xc0, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x07, 0xc0, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x07, 0xc0, 0x00, 0x00, 0x00,
0x00, 0x0f, 0x07, 0x87, 0xff, 0xff, 0xe0, 0x00,
0x00, 0x1f, 0x8f, 0xc7, 0xff, 0xff, 0xf1, 0x00,
0x01, 0x1f, 0x8f, 0xc7, 0xff, 0xff, 0xf1, 0x80,
0x03, 0x1f, 0x8f, 0xc7, 0xff, 0xff, 0xf1, 0x80,
0x07, 0x1f, 0x8f, 0xc7, 0xff, 0xff, 0xe1, 0xc0,
0x07, 0x1f, 0x8f, 0xc7, 0xc0, 0x00, 0x01, 0xe0,
0x0f, 0x1f, 0x8f, 0xc7, 0xc0, 0x00, 0x01, 0xe0,
0x0f, 0x1f, 0x8f, 0xc7, 0xc0, 0x00, 0x01, 0xf0,
0x1f, 0x1f, 0x8f, 0xc7, 0xc0, 0x00, 0x01, 0xf0,
0x1f, 0x1f, 0x8f, 0xc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 0x00, 0x07, 0xc7, 0xe3, 0xf1, 0xe0,
0x0f, 0x00, 0x00, 0x07, 0xc7, 0xe3, 0xf1, 0xe0,
0x0f, 0x00, 0x00, 0x07, 0xc7, 0xe3, 0xf1, 0xc0,
0x07, 0x0f, 0xff, 0xff, 0xc7, 0xe3, 0xf1, 0xc0,
0x03, 0x1f, 0xff, 0xff, 0xc7, 0xe3, 0xf1, 0x80,
0x03, 0x1f, 0xff, 0xff, 0xc7, 0xe3, 0xf1, 0x00,
0x01, 0x1f, 0xff, 0xff, 0xc7, 0xe3, 0xf0, 0x00,
0x00, 0x1f, 0xff, 0xff, 0xc7, 0xe3, 0xf0, 0x00,
0x00, 0x0f, 0xff, 0xff, 0xc3, 0xc1, 0xe0, 0x00,
0x00, 0x00, 0x00, 0x07, 0xc0, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x07, 0xc0, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x07, 0xc0, 0x00, 0x00, 0x00,
0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x00,
0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00,
0x00, 0x01, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00,
0x00, 0x00, 0x7f, 0xff, 0xff, 0xfc, 0x00, 0x00,
0x00, 0x00, 0x1f, 0xff, 0xff, 0xf0, 0x00, 0x00,
0x00, 0x00, 0x07, 0xff, 0xff, 0x80, 0x00, 0x00,
0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
#endif
20 changes: 18 additions & 2 deletions Marlin/example_configurations/Felix/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,24 @@
// 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 STRING_DISTRIBUTION_DATE // will be shown during bootup in line 2
#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during boot in line 1
#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during boot in line 2

//
// *** VENDORS PLEASE READ *****************************************************
//
// Marlin now allow you to have a vendor boot image to be displayed on machine
// start. When SHOW_CUSTOM_BOOTSCREEN is defined Marlin will first show your
// custom boot image and them the default Marlin boot image is shown.
//
// We suggest for you to take advantage of this new feature and keep the Marlin
// boot image unmodified. For an example have a look at the bq Hephestos 2
// example configuration folder.
//
//#define SHOW_CUSTOM_BOOTSCREEN
#if ENABLED(SHOW_BOOTSCREEN) && ENABLED(SHOW_CUSTOM_BOOTSCREEN)
#include "_bootscreen.h"
#endif

// @section machine

Expand Down
Loading