#include #include #include #include "liquid.h" #include "graphics/drawing.h" #define BOOTANIM_TIME_MS 2000 struct BootScene { struct Scene base; uint32_t cnt; }; static struct SceneEvent onTick(struct BootScene *self, uint32_t millis) { self->cnt += millis; // ms if (self->cnt >= BOOTANIM_TIME_MS) { return SceneEvent_Close(0, NULL); } return SceneEvent_None(); } static void paint(struct BootScene *self) { LCD_clearDisplay(0); LCD_setBitmapFullScreen(Bitmap_Get("boot_logo")->bytes); } struct Scene *NewScene_Boot(void) { struct BootScene *scene = calloc(1, sizeof(struct BootScene)); scene->base.paint = (Scene_paint_t) paint; scene->base.onTick = (Scene_onTick_t) onTick; return (struct Scene *) scene; }