Browse Source

DOGM bootscreen cleanup

pull/1/head
Scott Lahteine 5 years ago
parent
commit
5d2c5877f7
  1. 7
      Marlin/src/inc/Conditionals_LCD.h
  2. 18
      Marlin/src/lcd/dogm/dogm_Bootscreen.h
  3. 9
      Marlin/src/lcd/dogm/ultralcd_DOGM.cpp

7
Marlin/src/inc/Conditionals_LCD.h

@ -338,13 +338,6 @@
#endif
#endif
// Boot screens
#if !HAS_SPI_LCD
#undef SHOW_BOOTSCREEN
#elif !defined(BOOTSCREEN_TIMEOUT)
#define BOOTSCREEN_TIMEOUT 2500
#endif
/**
* Extruders have some combination of stepper motors and hotends
* so we separate these concepts into the defines:

18
Marlin/src/lcd/dogm/dogm_Bootscreen.h

@ -29,16 +29,17 @@
#include "../../inc/MarlinConfig.h"
#if ENABLED(SHOW_BOOTSCREEN)
//#define START_BMPHIGH // Costs 399 bytes more flash
#if ENABLED(SHOW_CUSTOM_BOOTSCREEN)
#include "../../../_Bootscreen.h"
#ifndef CUSTOM_BOOTSCREEN_TIMEOUT
#define CUSTOM_BOOTSCREEN_TIMEOUT 2500
#ifndef CUSTOM_BOOTSCREEN_BMP_BYTEWIDTH
#define CUSTOM_BOOTSCREEN_BMP_BYTEWIDTH ((CUSTOM_BOOTSCREEN_BMPWIDTH + 7) / 8)
#endif
#ifndef CUSTOM_BOOTSCREEN_BMPHEIGHT
#define CUSTOM_BOOTSCREEN_BMPHEIGHT (sizeof(custom_start_bmp) / (CUSTOM_BOOTSCREEN_BMP_BYTEWIDTH))
#endif
#endif
@ -124,12 +125,3 @@
#endif
static_assert(sizeof(start_bmp) == (START_BMP_BYTEWIDTH) * (START_BMPHEIGHT), "Bootscreen (start_bmp) dimensions don't match data.");
#endif
#ifndef CUSTOM_BOOTSCREEN_BMP_BYTEWIDTH
#define CUSTOM_BOOTSCREEN_BMP_BYTEWIDTH ((CUSTOM_BOOTSCREEN_BMPWIDTH + 7) / 8)
#endif
#ifndef CUSTOM_BOOTSCREEN_BMPHEIGHT
#define CUSTOM_BOOTSCREEN_BMPHEIGHT (sizeof(custom_start_bmp) / (CUSTOM_BOOTSCREEN_BMP_BYTEWIDTH))
#endif

9
Marlin/src/lcd/dogm/ultralcd_DOGM.cpp

@ -41,7 +41,10 @@
#include "ultralcd_DOGM.h"
#include "u8g_fontutf8.h"
#if ENABLED(SHOW_BOOTSCREEN)
#include "dogm_Bootscreen.h"
#endif
#include "../lcdprint.h"
#include "../fontutils.h"
@ -138,6 +141,9 @@ void MarlinUI::set_font(const MarlinFont font_nr) {
#else
draw_custom_bootscreen(custom_start_bmp);
#endif
#ifndef CUSTOM_BOOTSCREEN_TIMEOUT
#define CUSTOM_BOOTSCREEN_TIMEOUT 2500
#endif
safe_delay(CUSTOM_BOOTSCREEN_TIMEOUT);
}
@ -173,6 +179,9 @@ void MarlinUI::set_font(const MarlinFont font_nr) {
u8g.drawStr(txt2X, height - (MENU_FONT_HEIGHT) * 1 / 2, STRING_SPLASH_LINE2);
#endif
} while (u8g.nextPage());
#ifndef BOOTSCREEN_TIMEOUT
#define BOOTSCREEN_TIMEOUT 2500
#endif
safe_delay(BOOTSCREEN_TIMEOUT);
}

Loading…
Cancel
Save