summaryrefslogtreecommitdiffstats
path: root/tmk_core/common/magic.c
diff options
context:
space:
mode:
authorJack Humbert <jack.humb@gmail.com>2016-04-17 00:51:58 +0200
committerJack Humbert <jack.humb@gmail.com>2016-04-17 00:51:58 +0200
commitab19ebd08a8b955775e6fa94cdf6b8d128d8b43c (patch)
tree7120e8037a1a9935b3b9e4109e251530f893c3b3 /tmk_core/common/magic.c
parent5f648b6c4060d586c343ea05562c607e2630dfc4 (diff)
downloadqmk_firmware-ab19ebd08a8b955775e6fa94cdf6b8d128d8b43c.tar.gz
qmk_firmware-ab19ebd08a8b955775e6fa94cdf6b8d128d8b43c.tar.xz
MAGIC functionality, AG swap in default layout
Diffstat (limited to 'tmk_core/common/magic.c')
-rw-r--r--tmk_core/common/magic.c36
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 @@
+#include <stdint.h>
+#include <stdbool.h>
+#include <util/delay.h>
+#include "matrix.h"
+#include "bootloader.h"
+#include "debug.h"
+#include "keymap.h"
+#include "host.h"
+#include "action_layer.h"
+#include "eeconfig.h"
+#include "magic.h"
+
+keymap_config_t keymap_config;
+
+void magic(void)
+{
+ /* check signature */
+ if (!eeconfig_is_enabled()) {
+ eeconfig_init();
+ }
+
+ /* debug enable */
+ debug_config.raw = eeconfig_read_debug();
+
+ /* keymap config */
+ keymap_config.raw = eeconfig_read_keymap();
+
+#ifdef NKRO_ENABLE
+ keyboard_nkro = keymap_config.nkro;
+#endif
+
+ uint8_t default_layer = 0;
+ default_layer = eeconfig_read_default_layer();
+ default_layer_set((uint32_t)default_layer);
+
+} \ No newline at end of file