rad_sens.h 925 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #include <furi.h>
  2. #include <gui/gui.h>
  3. #include <gui/elements.h>
  4. #include <gui/view_dispatcher.h>
  5. #include <gui/modules/dialog_ex.h>
  6. #include <storage/storage.h>
  7. #include <stdlib.h>
  8. #include <power/power_service/power.h>
  9. #include <rad_sens_icons.h>
  10. #include <notification/notification.h>
  11. typedef struct RadSensModel RadSensModel;
  12. #define HISTORY_LENGTH 120
  13. typedef struct {
  14. Gui* gui;
  15. NotificationApp* notification;
  16. ViewDispatcher* view_dispatcher;
  17. View* view;
  18. FuriThread* worker_thread;
  19. FuriTimer* timer;
  20. Power* power;
  21. RadSensModel* model;
  22. } RadSensApp;
  23. struct RadSensModel {
  24. bool connected;
  25. bool verified;
  26. uint32_t dyn_intensity;
  27. uint32_t stat_intensity;
  28. uint16_t new_impulse_count;
  29. uint16_t impulse_count;
  30. bool vibro_on;
  31. bool show_history;
  32. uint32_t dyn_intensity_history[HISTORY_LENGTH];
  33. uint8_t dyn_intensity_history_index;
  34. PowerInfo info;
  35. };