mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2024-12-15 08:43:37 +03:00
b9a766d909
* Added support for running applications from SD card (FAPs - Flipper Application Packages) * Added plugin_dist target for fbt to build FAPs * All apps of type FlipperAppType.EXTERNAL and FlipperAppType.PLUGIN are built as FAPs by default * Updated VSCode configuration for new fbt features - re-deploy stock configuration to use them * Added debugging support for FAPs with fbt debug & VSCode * Added public firmware API with automated versioning Co-authored-by: hedger <hedger@users.noreply.github.com> Co-authored-by: SG <who.just.the.doctor@gmail.com> Co-authored-by: あく <alleteam@gmail.com>
58 lines
1.3 KiB
C
58 lines
1.3 KiB
C
#pragma once
|
|
|
|
#include <core/pubsub.h>
|
|
#include "gui/view.h"
|
|
#include "helpers/dolphin_deed.h"
|
|
#include <stdbool.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#define RECORD_DOLPHIN "dolphin"
|
|
|
|
typedef struct Dolphin Dolphin;
|
|
|
|
typedef struct {
|
|
uint32_t icounter;
|
|
uint32_t butthurt;
|
|
uint64_t timestamp;
|
|
uint8_t level;
|
|
bool level_up_is_pending;
|
|
} DolphinStats;
|
|
|
|
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);
|
|
|
|
/** Retrieve dolphin stats
|
|
* Thread safe, blocking
|
|
*/
|
|
DolphinStats dolphin_stats(Dolphin* dolphin);
|
|
|
|
/** Flush dolphin queue and save state
|
|
* Thread safe, blocking
|
|
*/
|
|
void dolphin_flush(Dolphin* dolphin);
|
|
|
|
void dolphin_upgrade_level(Dolphin* dolphin);
|
|
|
|
FuriPubSub* dolphin_get_pubsub(Dolphin* dolphin);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|