clock_app.h 800 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #pragma once
  2. #include <input/input.h>
  3. #include <locale/locale.h>
  4. #define TAG "Clock"
  5. #define CLOCK_ISO_DATE_FORMAT "%.4d-%.2d-%.2d"
  6. #define CLOCK_RFC_DATE_FORMAT "%.2d-%.2d-%.4d"
  7. #define CLOCK_TIME_FORMAT "%.2d:%.2d:%.2d"
  8. #define MERIDIAN_FORMAT "%s"
  9. #define MERIDIAN_STRING_AM "AM"
  10. #define MERIDIAN_STRING_PM "PM"
  11. #define TIME_LEN 12
  12. #define DATE_LEN 14
  13. #define MERIDIAN_LEN 3
  14. typedef enum {
  15. EventTypeTick,
  16. EventTypeKey,
  17. } EventType;
  18. typedef struct {
  19. EventType type;
  20. InputEvent input;
  21. } PluginEvent;
  22. typedef struct {
  23. LocaleDateFormat date_format;
  24. LocaleTimeFormat time_format;
  25. DateTime datetime;
  26. FuriMutex* mutex;
  27. FuriMessageQueue* event_queue;
  28. uint32_t timer_start_timestamp;
  29. uint32_t timer_stopped_seconds;
  30. bool timer_running;
  31. } ClockState;