aboutsummaryrefslogtreecommitdiff
path: root/tmk_core/common
diff options
context:
space:
mode:
Diffstat (limited to 'tmk_core/common')
-rw-r--r--tmk_core/common/action_util.c10
-rw-r--r--tmk_core/common/bootmagic.c4
-rw-r--r--tmk_core/common/command.c6
-rw-r--r--tmk_core/common/host.c5
-rw-r--r--tmk_core/common/host.h4
-rw-r--r--tmk_core/common/keyboard.c4
-rw-r--r--tmk_core/common/magic.c4
7 files changed, 13 insertions, 24 deletions
diff --git a/tmk_core/common/action_util.c b/tmk_core/common/action_util.c
index 61ff202be..cb4b25264 100644
--- a/tmk_core/common/action_util.c
+++ b/tmk_core/common/action_util.c
@@ -20,6 +20,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
20#include "action_util.h" 20#include "action_util.h"
21#include "action_layer.h" 21#include "action_layer.h"
22#include "timer.h" 22#include "timer.h"
23#include "keycode_config.h"
24
25extern keymap_config_t keymap_config;
26
23 27
24static inline void add_key_byte(uint8_t code); 28static inline void add_key_byte(uint8_t code);
25static inline void del_key_byte(uint8_t code); 29static inline void del_key_byte(uint8_t code);
@@ -139,7 +143,7 @@ void send_keyboard_report(void) {
139void add_key(uint8_t key) 143void add_key(uint8_t key)
140{ 144{
141#ifdef NKRO_ENABLE 145#ifdef NKRO_ENABLE
142 if (keyboard_protocol && keyboard_nkro) { 146 if (keyboard_protocol && keymap_config.nkro) {
143 add_key_bit(key); 147 add_key_bit(key);
144 return; 148 return;
145 } 149 }
@@ -150,7 +154,7 @@ void add_key(uint8_t key)
150void del_key(uint8_t key) 154void del_key(uint8_t key)
151{ 155{
152#ifdef NKRO_ENABLE 156#ifdef NKRO_ENABLE
153 if (keyboard_protocol && keyboard_nkro) { 157 if (keyboard_protocol && keymap_config.nkro) {
154 del_key_bit(key); 158 del_key_bit(key);
155 return; 159 return;
156 } 160 }
@@ -231,7 +235,7 @@ uint8_t has_anymod(void)
231uint8_t get_first_key(void) 235uint8_t get_first_key(void)
232{ 236{
233#ifdef NKRO_ENABLE 237#ifdef NKRO_ENABLE
234 if (keyboard_protocol && keyboard_nkro) { 238 if (keyboard_protocol && keymap_config.nkro) {
235 uint8_t i = 0; 239 uint8_t i = 0;
236 for (; i < KEYBOARD_REPORT_BITS && !keyboard_report->nkro.bits[i]; i++) 240 for (; i < KEYBOARD_REPORT_BITS && !keyboard_report->nkro.bits[i]; i++)
237 ; 241 ;
diff --git a/tmk_core/common/bootmagic.c b/tmk_core/common/bootmagic.c
index 6730a2a4a..2c6bcbae5 100644
--- a/tmk_core/common/bootmagic.c
+++ b/tmk_core/common/bootmagic.c
@@ -83,10 +83,6 @@ void bootmagic(void)
83 } 83 }
84 eeconfig_update_keymap(keymap_config.raw); 84 eeconfig_update_keymap(keymap_config.raw);
85 85
86#ifdef NKRO_ENABLE
87 keyboard_nkro = keymap_config.nkro;
88#endif
89
90 /* default layer */ 86 /* default layer */
91 uint8_t default_layer = 0; 87 uint8_t default_layer = 0;
92 if (bootmagic_scan_keycode(BOOTMAGIC_KEY_DEFAULT_LAYER_0)) { default_layer |= (1<<0); } 88 if (bootmagic_scan_keycode(BOOTMAGIC_KEY_DEFAULT_LAYER_0)) { default_layer |= (1<<0); }
diff --git a/tmk_core/common/command.c b/tmk_core/common/command.c
index 476fc6fe3..54d6117fd 100644
--- a/tmk_core/common/command.c
+++ b/tmk_core/common/command.c
@@ -238,7 +238,7 @@ static void print_status(void)
238 print_val_hex8(keyboard_protocol); 238 print_val_hex8(keyboard_protocol);
239 print_val_hex8(keyboard_idle); 239 print_val_hex8(keyboard_idle);
240#ifdef NKRO_ENABLE 240#ifdef NKRO_ENABLE
241 print_val_hex8(keyboard_nkro); 241 print_val_hex8(keymap_config.nkro);
242#endif 242#endif
243 print_val_hex32(timer_read32()); 243 print_val_hex32(timer_read32());
244 244
@@ -435,8 +435,8 @@ static bool command_common(uint8_t code)
435 // NKRO toggle 435 // NKRO toggle
436 case MAGIC_KC(MAGIC_KEY_NKRO): 436 case MAGIC_KC(MAGIC_KEY_NKRO):
437 clear_keyboard(); // clear to prevent stuck keys 437 clear_keyboard(); // clear to prevent stuck keys
438 keyboard_nkro = !keyboard_nkro; 438 keymap_config.nkro = !keymap_config.nkro;
439 if (keyboard_nkro) { 439 if (keymap_config.nkro) {
440 print("NKRO: on\n"); 440 print("NKRO: on\n");
441 } else { 441 } else {
442 print("NKRO: off\n"); 442 print("NKRO: off\n");
diff --git a/tmk_core/common/host.c b/tmk_core/common/host.c
index 11a05c2dd..e12b62216 100644
--- a/tmk_core/common/host.c
+++ b/tmk_core/common/host.c
@@ -22,11 +22,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
22#include "util.h" 22#include "util.h"
23#include "debug.h" 23#include "debug.h"
24 24
25
26#ifdef NKRO_ENABLE
27bool keyboard_nkro = true;
28#endif
29
30static host_driver_t *driver; 25static host_driver_t *driver;
31static uint16_t last_system_report = 0; 26static uint16_t last_system_report = 0;
32static uint16_t last_consumer_report = 0; 27static uint16_t last_consumer_report = 0;
diff --git a/tmk_core/common/host.h b/tmk_core/common/host.h
index 9814b10d2..aeabba710 100644
--- a/tmk_core/common/host.h
+++ b/tmk_core/common/host.h
@@ -28,10 +28,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
28extern "C" { 28extern "C" {
29#endif 29#endif
30 30
31#ifdef NKRO_ENABLE
32extern bool keyboard_nkro;
33#endif
34
35extern uint8_t keyboard_idle; 31extern uint8_t keyboard_idle;
36extern uint8_t keyboard_protocol; 32extern uint8_t keyboard_protocol;
37 33
diff --git a/tmk_core/common/keyboard.c b/tmk_core/common/keyboard.c
index c46a701b3..371d93f3e 100644
--- a/tmk_core/common/keyboard.c
+++ b/tmk_core/common/keyboard.c
@@ -57,6 +57,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
57# include "visualizer/visualizer.h" 57# include "visualizer/visualizer.h"
58#endif 58#endif
59 59
60
61
60#ifdef MATRIX_HAS_GHOST 62#ifdef MATRIX_HAS_GHOST
61static bool has_ghost_in_row(uint8_t row) 63static bool has_ghost_in_row(uint8_t row)
62{ 64{
@@ -106,7 +108,7 @@ void keyboard_init(void) {
106 rgblight_init(); 108 rgblight_init();
107#endif 109#endif
108#if defined(NKRO_ENABLE) && defined(FORCE_NKRO) 110#if defined(NKRO_ENABLE) && defined(FORCE_NKRO)
109 keyboard_nkro = true; 111 keymap_config.nkro = 1;
110#endif 112#endif
111} 113}
112 114
diff --git a/tmk_core/common/magic.c b/tmk_core/common/magic.c
index 194e4cc02..49617a3d1 100644
--- a/tmk_core/common/magic.c
+++ b/tmk_core/common/magic.c
@@ -27,10 +27,6 @@ void magic(void)
27 /* keymap config */ 27 /* keymap config */
28 keymap_config.raw = eeconfig_read_keymap(); 28 keymap_config.raw = eeconfig_read_keymap();
29 29
30#ifdef NKRO_ENABLE
31 keyboard_nkro = keymap_config.nkro;
32#endif
33
34 uint8_t default_layer = 0; 30 uint8_t default_layer = 0;
35 default_layer = eeconfig_read_default_layer(); 31 default_layer = eeconfig_read_default_layer();
36 default_layer_set((uint32_t)default_layer); 32 default_layer_set((uint32_t)default_layer);