summaryrefslogtreecommitdiff
path: root/common/bootmagic.c
diff options
context:
space:
mode:
authorShayne Holmes <simon.snth@xoxy.net>2014-04-09 15:54:16 -0700
committerShayne Holmes <simon.snth@xoxy.net>2014-04-09 15:54:16 -0700
commite5bafff725f7b9cbfc364e64c74ea7f68bfc9900 (patch)
treea83f4e5b6b181f2aed5b12b12f10ba43972aef64 /common/bootmagic.c
parent894a387d1fd8c823b5339e524e1f9336601ce2ef (diff)
Adding NKRO virtual dip-switch, using existing bit in keymap byte.
This takes the last, reserved bit there, but doesn't necessitate a revision to the magic number because it doesn't alter byte order. Add reference to NKRO virtual dip-switch to documentation.
Diffstat (limited to 'common/bootmagic.c')
-rw-r--r--common/bootmagic.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/common/bootmagic.c b/common/bootmagic.c
index 036d490440..642d5face4 100644
--- a/common/bootmagic.c
+++ b/common/bootmagic.c
@@ -5,6 +5,7 @@
#include "bootloader.h"
#include "debug.h"
#include "keymap.h"
+#include "host.h"
#include "action_layer.h"
#include "eeconfig.h"
#include "bootmagic.h"
@@ -76,8 +77,15 @@ void bootmagic(void)
if (bootmagic_scan_keycode(BOOTMAGIC_KEY_SWAP_BACKSLASH_BACKSPACE)) {
keymap_config.swap_backslash_backspace = !keymap_config.swap_backslash_backspace;
}
+ if (bootmagic_scan_keycode(BOOTMAGIC_HOST_NKRO)) {
+ keymap_config.nkro = !keymap_config.nkro;
+ }
eeconfig_write_keymap(keymap_config.raw);
+#ifdef NKRO_ENABLE
+ keyboard_nkro = keymap_config.nkro;
+#endif
+
/* default layer */
uint8_t default_layer = 0;
if (bootmagic_scan_keycode(BOOTMAGIC_KEY_DEFAULT_LAYER_0)) { default_layer |= (1<<0); }