2020-12-18 20:15:29 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "dolphin.h"
|
|
|
|
#include "dolphin_state.h"
|
2021-01-08 04:42:48 +00:00
|
|
|
#include "dolphin_views.h"
|
2020-12-18 20:15:29 +00:00
|
|
|
|
|
|
|
#include <flipper_v2.h>
|
|
|
|
|
|
|
|
#include <gui/gui.h>
|
2021-01-08 04:42:48 +00:00
|
|
|
#include <gui/view_dispatcher.h>
|
2020-12-18 20:15:29 +00:00
|
|
|
#include <gui/canvas.h>
|
|
|
|
#include <menu/menu.h>
|
|
|
|
|
|
|
|
#include <assets_icons.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
DolphinEventTypeDeed,
|
2021-01-08 04:42:48 +00:00
|
|
|
DolphinEventTypeSave,
|
2020-12-18 20:15:29 +00:00
|
|
|
} DolphinEventType;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
DolphinEventType type;
|
|
|
|
union {
|
|
|
|
DolphinDeed deed;
|
|
|
|
};
|
|
|
|
} DolphinEvent;
|
|
|
|
|
|
|
|
struct Dolphin {
|
|
|
|
// Internal message queue
|
|
|
|
osMessageQueueId_t event_queue;
|
2021-01-08 04:42:48 +00:00
|
|
|
// State
|
|
|
|
DolphinState* state;
|
|
|
|
// Menu
|
|
|
|
ValueMutex* menu_vm;
|
|
|
|
// GUI
|
|
|
|
ViewDispatcher* idle_view_dispatcher;
|
|
|
|
View* idle_view_first_start;
|
|
|
|
View* idle_view_main;
|
|
|
|
View* idle_view_stats;
|
|
|
|
View* idle_view_debug;
|
2020-12-18 20:15:29 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
Dolphin* dolphin_alloc();
|
2021-01-08 04:42:48 +00:00
|
|
|
|
|
|
|
/* Save Dolphin state (write to permanent memory)
|
|
|
|
* Thread safe
|
|
|
|
*/
|
|
|
|
void dolphin_save(Dolphin* dolphin);
|