mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2024-12-20 20:01:54 +03:00
389ff92cc1
* Makefile, Scripts: new linter * About: remove ID from IC * Firmware: remove double define for DIVC/DIVR * Scripts: check folder names too. Docker: replace syntax check with make lint. * Reformat Sources and Migrate to new file naming convention * Docker: symlink clang-format-12 to clang-format * Add coding style guide
45 lines
946 B
C
45 lines
946 B
C
#pragma once
|
|
|
|
#include "furi/pubsub.h"
|
|
#include <furi.h>
|
|
#include <furi_hal.h>
|
|
|
|
#include "dolphin.h"
|
|
#include "helpers/dolphin_state.h"
|
|
|
|
typedef enum {
|
|
DolphinEventTypeDeed,
|
|
DolphinEventTypeStats,
|
|
DolphinEventTypeFlush,
|
|
DolphinEventTypeAnimationStartNewIdle,
|
|
DolphinEventTypeAnimationCheckBlocking,
|
|
DolphinEventTypeAnimationInteract,
|
|
} DolphinEventType;
|
|
|
|
typedef struct {
|
|
DolphinEventType type;
|
|
osEventFlagsId_t flag;
|
|
union {
|
|
DolphinDeed deed;
|
|
DolphinStats* stats;
|
|
};
|
|
} DolphinEvent;
|
|
|
|
struct Dolphin {
|
|
// State
|
|
DolphinState* state;
|
|
// Queue
|
|
osMessageQueueId_t event_queue;
|
|
FuriPubSub* pubsub;
|
|
};
|
|
|
|
Dolphin* dolphin_alloc();
|
|
|
|
void dolphin_free(Dolphin* dolphin);
|
|
|
|
void dolphin_event_send_async(Dolphin* dolphin, DolphinEvent* event);
|
|
|
|
void dolphin_event_send_wait(Dolphin* dolphin, DolphinEvent* event);
|
|
|
|
void dolphin_event_release(Dolphin* dolphin, DolphinEvent* event);
|