summaryrefslogtreecommitdiff
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)
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 99a3adaab6..ebe7150dcc 100644
--- a/common/action_util.c
+++ b/common/action_util.c
@@ -67,7 +67,7 @@ void send_keyboard_report(void) {
void add_key(uint8_t key)
{
#ifdef NKRO_ENABLE
- if (keyboard_nkro) {
+ if (keyboard_nkro && keyboard_protocol) {
add_key_bit(key);
return;
}
@@ -78,7 +78,7 @@ void add_key(uint8_t key)
void del_key(uint8_t key)
{
#ifdef NKRO_ENABLE
- if (keyboard_nkro) {
+ if (keyboard_nkro && keyboard_protocol) {
del_key_bit(key);
return;
}
@@ -151,7 +151,7 @@ uint8_t has_anymod(void)
uint8_t get_first_key(void)
{
#ifdef NKRO_ENABLE
- if (keyboard_nkro) {
+ if (keyboard_nkro && keyboard_protocol) {
uint8_t i = 0;
for (; i < REPORT_BITS && !keyboard_report->nkro.bits[i]; i++)
;
diff --git a/common/command.c b/common/command.c
index f6f2769513..d2f8eb8320 100644
--- a/common/command.c
+++ b/common/command.c
@@ -301,13 +301,13 @@ static bool command_common(uint8_t code)
case KC_S:
print("\n\n----- Status -----\n");
print_val_hex8(host_keyboard_leds());
+ print_val_hex8(keyboard_protocol);
+ print_val_hex8(keyboard_idle);
#ifdef PROTOCOL_PJRC
print_val_hex8(UDCON);
print_val_hex8(UDIEN);
print_val_hex8(UDINT);
print_val_hex8(usb_keyboard_leds);
- print_val_hex8(usb_keyboard_protocol);
- print_val_hex8(usb_keyboard_idle_config);
print_val_hex8(usb_keyboard_idle_count);
#endif
diff --git a/common/host.c b/common/host.c
index 1eafef75cc..2e56971bdd 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/>.
#ifdef NKRO_ENABLE
-bool keyboard_nkro = false;
+bool keyboard_nkro = true;
#endif
static host_driver_t *driver;
diff --git a/common/host.h b/common/host.h
index 8ff2629852..a56e6c3b04 100644
--- a/common/host.h
+++ b/common/host.h
@@ -32,6 +32,9 @@ extern "C" {
extern bool keyboard_nkro;
#endif
+uint8_t keyboard_idle;
+uint8_t keyboard_protocol;
+
/* host driver */
void host_set_driver(host_driver_t *driver);