diff options
Diffstat (limited to 'tmk_core/common/magic.c')
-rw-r--r-- | tmk_core/common/magic.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/tmk_core/common/magic.c b/tmk_core/common/magic.c new file mode 100644 index 000000000..f21d1346c --- /dev/null +++ b/tmk_core/common/magic.c | |||
@@ -0,0 +1,36 @@ | |||
1 | #include <stdint.h> | ||
2 | #include <stdbool.h> | ||
3 | #include <util/delay.h> | ||
4 | #include "matrix.h" | ||
5 | #include "bootloader.h" | ||
6 | #include "debug.h" | ||
7 | #include "keymap.h" | ||
8 | #include "host.h" | ||
9 | #include "action_layer.h" | ||
10 | #include "eeconfig.h" | ||
11 | #include "magic.h" | ||
12 | |||
13 | keymap_config_t keymap_config; | ||
14 | |||
15 | void magic(void) | ||
16 | { | ||
17 | /* check signature */ | ||
18 | if (!eeconfig_is_enabled()) { | ||
19 | eeconfig_init(); | ||
20 | } | ||
21 | |||
22 | /* debug enable */ | ||
23 | debug_config.raw = eeconfig_read_debug(); | ||
24 | |||
25 | /* keymap config */ | ||
26 | keymap_config.raw = eeconfig_read_keymap(); | ||
27 | |||
28 | #ifdef NKRO_ENABLE | ||
29 | keyboard_nkro = keymap_config.nkro; | ||
30 | #endif | ||
31 | |||
32 | uint8_t default_layer = 0; | ||
33 | default_layer = eeconfig_read_default_layer(); | ||
34 | default_layer_set((uint32_t)default_layer); | ||
35 | |||
36 | } \ No newline at end of file | ||