unleashed-firmware/applications/services/dolphin/dolphin_i.h
あく aa06328516
Furi, FuriHal: remove FreeRTOS headers leaks (#3179)
* Furi: remove direct FreeRTOS timers use
* Furi: eliminate FreeRTOS headers leak. What did it cost? Everything...
* SubGhz: proper public api for protocols. Format Sources.
* Furi: slightly less redundant declarations
* Desktop: proper types in printf
* Sync API Symbols
* Furi: add timer reset and fix dolphin service, fix unit tests
* Furi: proper timer restart method naming and correct behavior in timer stopped state.

---------

Co-authored-by: hedger <hedger@nanode.su>
2023-11-01 11:24:11 +04:00

44 lines
944 B
C

#pragma once
#include <core/pubsub.h>
#include <furi.h>
#include <furi_hal.h>
#include "dolphin.h"
#include "helpers/dolphin_state.h"
typedef enum {
DolphinEventTypeDeed,
DolphinEventTypeStats,
DolphinEventTypeFlush,
DolphinEventTypeIncreaseButthurt,
DolphinEventTypeClearLimits,
} DolphinEventType;
typedef struct {
DolphinEventType type;
FuriEventFlag* flag;
union {
DolphinDeed deed;
DolphinStats* stats;
};
} DolphinEvent;
struct Dolphin {
// State
DolphinState* state;
// Queue
FuriMessageQueue* event_queue;
FuriPubSub* pubsub;
FuriTimer* butthurt_timer;
FuriTimer* flush_timer;
FuriTimer* clear_limits_timer;
};
Dolphin* dolphin_alloc();
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);