mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2024-12-27 15:22:29 +03: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>
45 lines
944 B
C
45 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);
|