desktop_debug.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #pragma once
  2. #include <gui/gui_i.h>
  3. #include <gui/view.h>
  4. #include <gui/canvas.h>
  5. #include <gui/elements.h>
  6. #include <furi.h>
  7. #include <storage/storage.h>
  8. #include <time.h>
  9. typedef enum {
  10. DesktopDebugEventDeed,
  11. DesktopDebugEventWrongDeed,
  12. DesktopDebugEventSaveState,
  13. DesktopDebugEventExit,
  14. } DesktopDebugEvent;
  15. typedef struct DesktopDebugView DesktopDebugView;
  16. typedef void (*DesktopDebugViewCallback)(DesktopDebugEvent event, void* context);
  17. // Debug info
  18. typedef enum {
  19. DesktopViewStatsFw,
  20. DesktopViewStatsBoot,
  21. DesktopViewStatsMeta,
  22. DesktopViewStatsTotalCount,
  23. } DesktopViewStatsScreens;
  24. struct DesktopDebugView {
  25. View* view;
  26. DesktopDebugViewCallback callback;
  27. void* context;
  28. };
  29. typedef struct {
  30. uint32_t icounter;
  31. uint32_t butthurt;
  32. uint64_t timestamp;
  33. DesktopViewStatsScreens screen;
  34. } DesktopDebugViewModel;
  35. void desktop_debug_set_callback(
  36. DesktopDebugView* debug_view,
  37. DesktopDebugViewCallback callback,
  38. void* context);
  39. View* desktop_debug_get_view(DesktopDebugView* debug_view);
  40. DesktopDebugView* desktop_debug_alloc();
  41. void desktop_debug_free(DesktopDebugView* debug_view);
  42. void desktop_debug_get_dolphin_data(DesktopDebugView* debug_view);
  43. void desktop_debug_reset_screen_idx(DesktopDebugView* debug_view);