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_root.c

45 lines
1.0 KiB

#include <malloc.h>
#include <stdio.h>
#include <graphics/bitmaps.h>
#include "scenes.h"
#include "liquid.h"
#include "analog.h"
#include "graphics/nokia.h"
#include "graphics/drawing.h"
/**
* The struct is allocated bigger than 'Scene' to accommodate private fields.
* Since the base struct is located at the beginning, it can be cast and passed around as Scene.
*/
struct RootScene {
struct Scene base;
};
static struct SceneEvent Root_init(struct RootScene *self)
{
return SceneEvent_OpenChild(NewScene_Boot(), 1);
}
struct SceneEvent Root_onChildReturn(
struct RootScene *self,
uint32_t tag,
int32_t status,
void *data)
{
if (tag == 1) {
return SceneEvent_OpenChild(NewScene_Demo(), 0);
}
// this should be unreachable
return SceneEvent_None();
}
struct Scene *NewScene_Root(void) {
struct RootScene *scene = calloc(1, sizeof(struct RootScene));
scene->base.init = (Scene_init_t) Root_init;
scene->base.onChildReturn = (Scene_onChildReturn_t) Root_onChildReturn;
return (struct Scene *) scene;
}