-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjclock_settings.h
58 lines (46 loc) · 1.53 KB
/
jclock_settings.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#pragma once
#include "jclock_settings_filename.h"
#include <furi_hal.h>
#include <stdint.h>
#include <stdbool.h>
#include <toolbox/saved_struct.h>
#include <storage/storage.h>
#define JCLOCK_SETTINGS_VER (1)
#define JCLOCK_SETTINGS_PATH EXT_PATH(JCLOCK_SETTINGS_FILE_NAME)
#define JCLOCK_SETTINGS_MAGIC (0xC1)
#define SAVE_JCLOCK_SETTINGS(x) \
saved_struct_save( \
JCLOCK_SETTINGS_PATH, \
(x), \
sizeof(ClockSettings), \
JCLOCK_SETTINGS_MAGIC, \
JCLOCK_SETTINGS_VER)
#define LOAD_JCLOCK_SETTINGS(x) \
saved_struct_load( \
JCLOCK_SETTINGS_PATH, \
(x), \
sizeof(ClockSettings), \
JCLOCK_SETTINGS_MAGIC, \
JCLOCK_SETTINGS_VER)
typedef enum {
H12 = 1,
H24 = 2,
} TimeFormat;
typedef enum {
Iso = 1, // ISO 8601: yyyy-mm-dd
Rfc = 2, // RFC 5322: dd-mm-yyyy
} DateFormat;
typedef struct {
TimeFormat TimeFormat;
DateFormat DateFormat;
bool isJJYEnabled;
float JJYDtz;
bool isBacklightOnCharge;
} ClockSettings;
extern const ClockSettings defaultClockSettings;
#define JJY_DTZ_COUNT 193
extern const char* const JJYDtzText[JJY_DTZ_COUNT];
extern const float JJYDtzValue[JJY_DTZ_COUNT];
//extern uint8_t jclock_value_index_uint32(const uint32_t value, const uint32_t values[], uint8_t values_count);
//extern uint8_t jclock_value_index_float(const float value, const float values[], uint8_t values_count);
//extern int32_t jclock_settings(void* context_settings);