aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authortmk <nobody@nowhere>2014-04-25 15:32:21 +0900
committertmk <nobody@nowhere>2014-04-27 04:16:49 +0900
commit5e3f2d2b2e5065a04495f2c55fae0849966b5d23 (patch)
tree4e224b2a2d6a6445ae489ab0b1c150cc3c4a83e4 /common
parent62117e7ea77bf036e4e08bb02d682311e3c3d401 (diff)
downloadqmk_firmware-5e3f2d2b2e5065a04495f2c55fae0849966b5d23.tar.gz
qmk_firmware-5e3f2d2b2e5065a04495f2c55fae0849966b5d23.zip
Make NKRO deafult when it is available
- NKRO is used only when keyboard_protocol = 1(report)
Diffstat (limited to 'common')
-rw-r--r--common/action_util.c6
-rw-r--r--common/command.c4
-rw-r--r--common/host.c2
-rw-r--r--common/host.h3
4 files changed, 9 insertions, 6 deletions
diff --git a/common/action_util.c b/common/action_util.c
index 99a3adaab..ebe7150dc 100644
--- a/common/action_util.c
+++ b/common/action_util.c
@@ -67,7 +67,7 @@ void send_keyboard_report(void) {
67void add_key(uint8_t key) 67void add_key(uint8_t key)
68{ 68{
69#ifdef NKRO_ENABLE 69#ifdef NKRO_ENABLE
70 if (keyboard_nkro) { 70 if (keyboard_nkro && keyboard_protocol) {
71 add_key_bit(key); 71 add_key_bit(key);
72 return; 72 return;
73 } 73 }
@@ -78,7 +78,7 @@ void add_key(uint8_t key)
78void del_key(uint8_t key) 78void del_key(uint8_t key)
79{ 79{
80#ifdef NKRO_ENABLE 80#ifdef NKRO_ENABLE
81 if (keyboard_nkro) { 81 if (keyboard_nkro && keyboard_protocol) {
82 del_key_bit(key); 82 del_key_bit(key);
83 return; 83 return;
84 } 84 }
@@ -151,7 +151,7 @@ uint8_t has_anymod(void)
151uint8_t get_first_key(void) 151uint8_t get_first_key(void)
152{ 152{
153#ifdef NKRO_ENABLE 153#ifdef NKRO_ENABLE
154 if (keyboard_nkro) { 154 if (keyboard_nkro && keyboard_protocol) {
155 uint8_t i = 0; 155 uint8_t i = 0;
156 for (; i < REPORT_BITS && !keyboard_report->nkro.bits[i]; i++) 156 for (; i < REPORT_BITS && !keyboard_report->nkro.bits[i]; i++)
157 ; 157 ;
diff --git a/common/command.c b/common/command.c
index f6f276951..d2f8eb832 100644
--- a/common/command.c
+++ b/common/command.c
@@ -301,13 +301,13 @@ static bool command_common(uint8_t code)
301 case KC_S: 301 case KC_S:
302 print("\n\n----- Status -----\n"); 302 print("\n\n----- Status -----\n");
303 print_val_hex8(host_keyboard_leds()); 303 print_val_hex8(host_keyboard_leds());
304 print_val_hex8(keyboard_protocol);
305 print_val_hex8(keyboard_idle);
304#ifdef PROTOCOL_PJRC 306#ifdef PROTOCOL_PJRC
305 print_val_hex8(UDCON); 307 print_val_hex8(UDCON);
306 print_val_hex8(UDIEN); 308 print_val_hex8(UDIEN);
307 print_val_hex8(UDINT); 309 print_val_hex8(UDINT);
308 print_val_hex8(usb_keyboard_leds); 310 print_val_hex8(usb_keyboard_leds);
309 print_val_hex8(usb_keyboard_protocol);
310 print_val_hex8(usb_keyboard_idle_config);
311 print_val_hex8(usb_keyboard_idle_count); 311 print_val_hex8(usb_keyboard_idle_count);
312#endif 312#endif
313 313
diff --git a/common/host.c b/common/host.c
index 1eafef75c..2e56971bd 100644
--- a/common/host.c
+++ b/common/host.c
@@ -24,7 +24,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
24 24
25 25
26#ifdef NKRO_ENABLE 26#ifdef NKRO_ENABLE
27bool keyboard_nkro = false; 27bool keyboard_nkro = true;
28#endif 28#endif
29 29
30static host_driver_t *driver; 30static host_driver_t *driver;
diff --git a/common/host.h b/common/host.h
index 8ff262985..a56e6c3b0 100644
--- a/common/host.h
+++ b/common/host.h
@@ -32,6 +32,9 @@ extern "C" {
32extern bool keyboard_nkro; 32extern bool keyboard_nkro;
33#endif 33#endif
34 34
35uint8_t keyboard_idle;
36uint8_t keyboard_protocol;
37
35 38
36/* host driver */ 39/* host driver */
37void host_set_driver(host_driver_t *driver); 40void host_set_driver(host_driver_t *driver);