mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-12-19 01:03:22 +00:00
aa06328516
* 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>
44 lines
944 B
C
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);
|