diff options
Diffstat (limited to 'tmk_core/protocol/pjrc/usb.c')
| -rw-r--r-- | tmk_core/protocol/pjrc/usb.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/tmk_core/protocol/pjrc/usb.c b/tmk_core/protocol/pjrc/usb.c index 1e6ba8719..09efbe076 100644 --- a/tmk_core/protocol/pjrc/usb.c +++ b/tmk_core/protocol/pjrc/usb.c | |||
| @@ -1,17 +1,17 @@ | |||
| 1 | /* USB Keyboard Plus Debug Channel Example for Teensy USB Development Board | 1 | /* USB Keyboard Plus Debug Channel Example for Teensy USB Development Board |
| 2 | * http://www.pjrc.com/teensy/usb_keyboard.html | 2 | * http://www.pjrc.com/teensy/usb_keyboard.html |
| 3 | * Copyright (c) 2009 PJRC.COM, LLC | 3 | * Copyright (c) 2009 PJRC.COM, LLC |
| 4 | * | 4 | * |
| 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy | 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
| 6 | * of this software and associated documentation files (the "Software"), to deal | 6 | * of this software and associated documentation files (the "Software"), to deal |
| 7 | * in the Software without restriction, including without limitation the rights | 7 | * in the Software without restriction, including without limitation the rights |
| 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | 8 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 9 | * copies of the Software, and to permit persons to whom the Software is | 9 | * copies of the Software, and to permit persons to whom the Software is |
| 10 | * furnished to do so, subject to the following conditions: | 10 | * furnished to do so, subject to the following conditions: |
| 11 | * | 11 | * |
| 12 | * The above copyright notice and this permission notice shall be included in | 12 | * The above copyright notice and this permission notice shall be included in |
| 13 | * all copies or substantial portions of the Software. | 13 | * all copies or substantial portions of the Software. |
| 14 | * | 14 | * |
| 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 16 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | 16 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 17 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | 17 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| @@ -41,6 +41,12 @@ | |||
| 41 | #include "action.h" | 41 | #include "action.h" |
| 42 | #include "action_util.h" | 42 | #include "action_util.h" |
| 43 | 43 | ||
| 44 | #ifdef NKRO_ENABLE | ||
| 45 | #include "keycode_config.h" | ||
| 46 | |||
| 47 | extern keymap_config_t keymap_config; | ||
| 48 | #endif | ||
| 49 | |||
| 44 | 50 | ||
| 45 | /************************************************************************** | 51 | /************************************************************************** |
| 46 | * | 52 | * |
| @@ -694,7 +700,7 @@ ISR(USB_GEN_vect) | |||
| 694 | } | 700 | } |
| 695 | /* TODO: should keep IDLE rate on each keyboard interface */ | 701 | /* TODO: should keep IDLE rate on each keyboard interface */ |
| 696 | #ifdef NKRO_ENABLE | 702 | #ifdef NKRO_ENABLE |
| 697 | if (!keyboard_nkro && keyboard_idle && (++div4 & 3) == 0) { | 703 | if (!keymap_config.nkro && keyboard_idle && (++div4 & 3) == 0) { |
| 698 | #else | 704 | #else |
| 699 | if (keyboard_idle && (++div4 & 3) == 0) { | 705 | if (keyboard_idle && (++div4 & 3) == 0) { |
| 700 | #endif | 706 | #endif |
| @@ -881,7 +887,7 @@ ISR(USB_COM_vect) | |||
| 881 | #endif | 887 | #endif |
| 882 | if (bmRequestType == 0x00 && wValue == DEVICE_REMOTE_WAKEUP) { | 888 | if (bmRequestType == 0x00 && wValue == DEVICE_REMOTE_WAKEUP) { |
| 883 | if (bRequest == SET_FEATURE) { | 889 | if (bRequest == SET_FEATURE) { |
| 884 | remote_wakeup = true; | 890 | remote_wakeup = true; |
| 885 | } else { | 891 | } else { |
| 886 | remote_wakeup = false; | 892 | remote_wakeup = false; |
| 887 | } | 893 | } |
| @@ -932,7 +938,7 @@ ISR(USB_COM_vect) | |||
| 932 | if (bRequest == HID_SET_PROTOCOL) { | 938 | if (bRequest == HID_SET_PROTOCOL) { |
| 933 | keyboard_protocol = wValue; | 939 | keyboard_protocol = wValue; |
| 934 | #ifdef NKRO_ENABLE | 940 | #ifdef NKRO_ENABLE |
| 935 | keyboard_nkro = !!keyboard_protocol; | 941 | keymap_config.nkro = !!keyboard_protocol; |
| 936 | #endif | 942 | #endif |
| 937 | clear_keyboard(); | 943 | clear_keyboard(); |
| 938 | //usb_wait_in_ready(); | 944 | //usb_wait_in_ready(); |
