dolphin_i.h 957 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #pragma once
  2. #include "dolphin.h"
  3. #include "dolphin_state.h"
  4. #include "dolphin_views.h"
  5. #include <furi.h>
  6. #include <api-hal.h>
  7. #include <gui/gui.h>
  8. #include <gui/view_dispatcher.h>
  9. #include <gui/canvas.h>
  10. #include <menu/menu.h>
  11. #include <assets_icons.h>
  12. #include <stdint.h>
  13. typedef enum {
  14. DolphinEventTypeDeed,
  15. DolphinEventTypeSave,
  16. } DolphinEventType;
  17. typedef struct {
  18. DolphinEventType type;
  19. union {
  20. DolphinDeed deed;
  21. };
  22. } DolphinEvent;
  23. struct Dolphin {
  24. // Internal message queue
  25. osMessageQueueId_t event_queue;
  26. // State
  27. DolphinState* state;
  28. // Menu
  29. ValueMutex* menu_vm;
  30. // GUI
  31. ViewDispatcher* idle_view_dispatcher;
  32. View* idle_view_first_start;
  33. View* idle_view_main;
  34. View* idle_view_up;
  35. View* idle_view_down;
  36. View* view_hw_mismatch;
  37. };
  38. Dolphin* dolphin_alloc();
  39. /* Save Dolphin state (write to permanent memory)
  40. * Thread safe
  41. */
  42. void dolphin_save(Dolphin* dolphin);