1
0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2024-11-27 22:08:02 +00:00

Show bootscreen later

Init display and show bootscreen later, but init display in `kill()`
to init outputs before the bootscreen delays but being able to display
kill errors.
This commit is contained in:
AnHardt 2016-06-14 01:59:50 +02:00
parent 17c86349c0
commit b4fedec0d1
4 changed files with 19 additions and 17 deletions

View File

@ -857,8 +857,6 @@ void setup() {
// loads data from EEPROM if available else uses defaults (and resets step acceleration rate) // loads data from EEPROM if available else uses defaults (and resets step acceleration rate)
Config_RetrieveSettings(); Config_RetrieveSettings();
lcd_init();
thermalManager.init(); // Initialize temperature loop thermalManager.init(); // Initialize temperature loop
#if ENABLED(DELTA) || ENABLED(SCARA) #if ENABLED(DELTA) || ENABLED(SCARA)
@ -906,6 +904,18 @@ void setup() {
pinMode(STAT_LED_BLUE, OUTPUT); pinMode(STAT_LED_BLUE, OUTPUT);
digitalWrite(STAT_LED_BLUE, LOW); // turn it off digitalWrite(STAT_LED_BLUE, LOW); // turn it off
#endif #endif
lcd_init();
#if ENABLED(SHOW_BOOTSCREEN)
#if ENABLED(DOGLCD)
delay(1000);
#elif ENABLED(ULTRA_LCD)
bootscreen();
lcd_init();
#endif
#endif
} }
/** /**
@ -8283,6 +8293,7 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) {
void kill(const char* lcd_msg) { void kill(const char* lcd_msg) {
#if ENABLED(ULTRA_LCD) #if ENABLED(ULTRA_LCD)
lcd_init();
lcd_setalertstatuspgm(lcd_msg); lcd_setalertstatuspgm(lcd_msg);
#else #else
UNUSED(lcd_msg); UNUSED(lcd_msg);

View File

@ -271,10 +271,8 @@ static void lcd_implementation_init() {
} }
} while (u8g.nextPage()); } while (u8g.nextPage());
if (show_bootscreen) {
delay(1000);
show_bootscreen = false; show_bootscreen = false;
}
#endif #endif
} }

View File

@ -52,8 +52,11 @@
#if ENABLED(DOGLCD) #if ENABLED(DOGLCD)
extern int lcd_contrast; extern int lcd_contrast;
void set_lcd_contrast(int value); void set_lcd_contrast(int value);
#elif ENABLED(SHOW_BOOTSCREEN)
void bootscreen();
#endif #endif
#define LCD_MESSAGEPGM(x) lcd_setstatuspgm(PSTR(x)) #define LCD_MESSAGEPGM(x) lcd_setstatuspgm(PSTR(x))
#define LCD_ALERTMESSAGEPGM(x) lcd_setalertstatuspgm(PSTR(x)) #define LCD_ALERTMESSAGEPGM(x) lcd_setalertstatuspgm(PSTR(x))

View File

@ -201,11 +201,6 @@ extern volatile uint8_t buttons; //an extended version of the last checked butt
#include "utf_mapper.h" #include "utf_mapper.h"
#if ENABLED(SHOW_BOOTSCREEN)
static void bootscreen();
static bool show_bootscreen = true;
#endif
#if ENABLED(LCD_PROGRESS_BAR) #if ENABLED(LCD_PROGRESS_BAR)
static millis_t progress_bar_ms = 0; static millis_t progress_bar_ms = 0;
#if PROGRESS_MSG_EXPIRE > 0 #if PROGRESS_MSG_EXPIRE > 0
@ -394,10 +389,6 @@ static void lcd_implementation_init(
lcd.begin(LCD_WIDTH, LCD_HEIGHT); lcd.begin(LCD_WIDTH, LCD_HEIGHT);
#endif #endif
#if ENABLED(SHOW_BOOTSCREEN)
if (show_bootscreen) bootscreen();
#endif
lcd_set_custom_characters( lcd_set_custom_characters(
#if ENABLED(LCD_PROGRESS_BAR) #if ENABLED(LCD_PROGRESS_BAR)
progress_bar_set progress_bar_set
@ -452,8 +443,7 @@ unsigned lcd_print(char c) { return charset_mapper(c); }
lcd.setCursor(indent, 2); lcd.print('\x02'); lcd_printPGM(PSTR( "------" )); lcd.print('\x03'); lcd.setCursor(indent, 2); lcd.print('\x02'); lcd_printPGM(PSTR( "------" )); lcd.print('\x03');
} }
static void bootscreen() { void bootscreen() {
show_bootscreen = false;
byte top_left[8] = { byte top_left[8] = {
B00000, B00000,
B00000, B00000,