mirror of
https://github.com/MarlinFirmware/Marlin.git
synced 2024-11-28 06:21:31 +00:00
Fix animated boot screen
This commit is contained in:
parent
127a4ada93
commit
86fd38ef42
@ -39,6 +39,10 @@
|
||||
|
||||
#include "../../../_Bootscreen.h"
|
||||
|
||||
#if ENABLED(CUSTOM_BOOTSCREEN_ANIMATED) && DISABLED(CUSTOM_BOOTSCREEN_ANIMATED_FRAME_TIME) && !defined(CUSTOM_BOOTSCREEN_FRAME_TIME)
|
||||
#define CUSTOM_BOOTSCREEN_FRAME_TIME 500 // (ms)
|
||||
#endif
|
||||
|
||||
#ifndef CUSTOM_BOOTSCREEN_BMPWIDTH
|
||||
#define CUSTOM_BOOTSCREEN_BMPWIDTH 128
|
||||
#endif
|
||||
|
@ -118,12 +118,10 @@ bool MarlinUI::detected() { return true; }
|
||||
#endif
|
||||
|
||||
#if ENABLED(CUSTOM_BOOTSCREEN_ANIMATED)
|
||||
const void * const frame_ptr = pgm_read_ptr(&custom_bootscreen_animation[frame]);
|
||||
#if ENABLED(CUSTOM_BOOTSCREEN_TIME_PER_FRAME)
|
||||
const boot_frame_t * const frame_info = (boot_frame_t*)frame_ptr;
|
||||
const u8g_pgm_uint8_t * const bmp = (u8g_pgm_uint8_t*)pgm_read_ptr(&frame_info->bitmap);
|
||||
#if ENABLED(CUSTOM_BOOTSCREEN_ANIMATED_FRAME_TIME)
|
||||
const u8g_pgm_uint8_t * const bmp = (u8g_pgm_uint8_t*)pgm_read_ptr(&custom_bootscreen_animation[frame].bitmap);
|
||||
#else
|
||||
const u8g_pgm_uint8_t * const bmp = (u8g_pgm_uint8_t*)frame_ptr;
|
||||
const u8g_pgm_uint8_t * const bmp = (u8g_pgm_uint8_t*)pgm_read_ptr(&custom_bootscreen_animation[frame]);
|
||||
#endif
|
||||
#else
|
||||
const u8g_pgm_uint8_t * const bmp = custom_start_bmp;
|
||||
@ -150,16 +148,15 @@ bool MarlinUI::detected() { return true; }
|
||||
constexpr millis_t frame_time = 0;
|
||||
constexpr uint8_t f = 0;
|
||||
#else
|
||||
#if DISABLED(CUSTOM_BOOTSCREEN_TIME_PER_FRAME)
|
||||
#if DISABLED(CUSTOM_BOOTSCREEN_ANIMATED_FRAME_TIME)
|
||||
constexpr millis_t frame_time = CUSTOM_BOOTSCREEN_FRAME_TIME;
|
||||
#endif
|
||||
LOOP_L_N(f, COUNT(custom_bootscreen_animation))
|
||||
#endif
|
||||
{
|
||||
#if ENABLED(CUSTOM_BOOTSCREEN_TIME_PER_FRAME)
|
||||
#if ENABLED(CUSTOM_BOOTSCREEN_ANIMATED_FRAME_TIME)
|
||||
const uint8_t fr = _MIN(f, COUNT(custom_bootscreen_animation) - 1);
|
||||
const boot_frame_t * const frame_info = (boot_frame_t*)pgm_read_ptr(&custom_bootscreen_animation[fr]);
|
||||
const millis_t frame_time = pgm_read_word(&frame_info->duration);
|
||||
const millis_t frame_time = pgm_read_word(&custom_bootscreen_animation[fr].duration);
|
||||
#endif
|
||||
u8g.firstPage();
|
||||
do { draw_custom_bootscreen(f); } while (u8g.nextPage());
|
||||
|
Loading…
Reference in New Issue
Block a user