pomodoro_timer.h 825 B

1234567891011121314151617181920212223242526272829303132333435
  1. #pragma once
  2. #include <gui/view.h>
  3. #include <furi.h>
  4. #include <furi_hal.h>
  5. #include <gui/elements.h>
  6. typedef struct PomodoroTimer PomodoroTimer;
  7. struct PomodoroTimer {
  8. View* view;
  9. };
  10. typedef struct PomodoroTimerModel PomodoroTimerModel;
  11. struct PomodoroTimerModel {
  12. bool ok_pressed;
  13. bool reset_pressed;
  14. bool back_pressed;
  15. bool connected;
  16. bool timer_running;
  17. bool rest_running;
  18. bool sound_playing;
  19. uint32_t timer_start_timestamp;
  20. uint32_t timer_stopped_seconds;
  21. uint32_t time_passed;
  22. uint32_t rest_start_timestamp;
  23. int counter;
  24. };
  25. void pomodoro_timer_process(PomodoroTimer* pomodoro_timer, InputEvent* event);
  26. void pomodoro_draw_callback(Canvas* canvas, void* context, int max_seconds, int max_seconds_rest);
  27. void pomodoro_timer_update(PomodoroTimer* pomodoro_timer);