dolphin.h 883 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #pragma once
  2. #include "furi/pubsub.h"
  3. #include "helpers/dolphin_deed.h"
  4. #include <stdbool.h>
  5. typedef struct Dolphin Dolphin;
  6. typedef struct {
  7. uint32_t icounter;
  8. uint32_t butthurt;
  9. uint64_t timestamp;
  10. uint8_t level;
  11. bool level_up_is_pending;
  12. } DolphinStats;
  13. typedef enum {
  14. DolphinPubsubEventUpdate,
  15. } DolphinPubsubEvent;
  16. /** Deed complete notification. Call it on deed completion.
  17. * See dolphin_deed.h for available deeds. In futures it will become part of assets.
  18. * Thread safe, async
  19. */
  20. void dolphin_deed(Dolphin* dolphin, DolphinDeed deed);
  21. /** Retrieve dolphin stats
  22. * Thread safe, blocking
  23. */
  24. DolphinStats dolphin_stats(Dolphin* dolphin);
  25. /** Flush dolphin queue and save state
  26. * Thread safe, blocking
  27. */
  28. void dolphin_flush(Dolphin* dolphin);
  29. void dolphin_upgrade_level(Dolphin* dolphin);
  30. FuriPubSub* dolphin_get_pubsub(Dolphin* dolphin);