1
mirror of https://github.com/flipperdevices/flipperzero-firmware.git synced 2025-12-12 04:41:26 +04:00

Services: simplify api (#2540)

Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
Sergey Gavrilov
2023-06-09 04:02:47 -07:00
committed by GitHub
parent 62939dd28b
commit 0e4344a83c
61 changed files with 94 additions and 100 deletions

View File

@@ -13,12 +13,13 @@
static void dolphin_update_clear_limits_timer_period(Dolphin* dolphin);
void dolphin_deed(Dolphin* dolphin, DolphinDeed deed) {
furi_assert(dolphin);
void dolphin_deed(DolphinDeed deed) {
Dolphin* dolphin = (Dolphin*)furi_record_open(RECORD_DOLPHIN);
DolphinEvent event;
event.type = DolphinEventTypeDeed;
event.deed = deed;
dolphin_event_send_async(dolphin, &event);
furi_record_close(RECORD_DOLPHIN);
}
DolphinStats dolphin_stats(Dolphin* dolphin) {

View File

@@ -26,18 +26,11 @@ typedef enum {
DolphinPubsubEventUpdate,
} DolphinPubsubEvent;
#define DOLPHIN_DEED(deed) \
do { \
Dolphin* dolphin = (Dolphin*)furi_record_open("dolphin"); \
dolphin_deed(dolphin, deed); \
furi_record_close("dolphin"); \
} while(0)
/** Deed complete notification. Call it on deed completion.
* See dolphin_deed.h for available deeds. In futures it will become part of assets.
* Thread safe, async
*/
void dolphin_deed(Dolphin* dolphin, DolphinDeed deed);
void dolphin_deed(DolphinDeed deed);
/** Retrieve dolphin stats
* Thread safe, blocking