esp32 firmware for a toaster reflow oven WIP!!!!!
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
reflower/main/scenes/scene_bootanim.c

35 lines
815 B

#include <malloc.h>
#include <stdio.h>
#include <graphics/bitmaps.h>
#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;
}