diff options
| author | IBNobody <ibnobody@gmail.com> | 2016-03-28 00:03:21 -0500 |
|---|---|---|
| committer | IBNobody <ibnobody@gmail.com> | 2016-03-28 00:03:21 -0500 |
| commit | 577971ab07a49405e1dcd8e5f75b3ecb87e710b9 (patch) | |
| tree | 802120d4417cbd8e56305f2153b11b54564ef9e9 | |
| parent | b7f0110d71bade83609d7a5c0b4243e521882e31 (diff) | |
| download | qmk_firmware-577971ab07a49405e1dcd8e5f75b3ecb87e710b9.tar.gz qmk_firmware-577971ab07a49405e1dcd8e5f75b3ecb87e710b9.zip | |
Magic Key Overrides / Keyboard Lock / Forced NKRO
Added Magic Key Overrides / Magic Key Cleanup / Added Keyboard Lock
option to template / Added forced NKRO option to template (disabled by
default)
| -rw-r--r-- | keyboard/retro_refit/Makefile | 23 | ||||
| -rw-r--r-- | keyboard/retro_refit/config.h | 47 | ||||
| -rw-r--r-- | quantum/template/Makefile | 23 | ||||
| -rw-r--r-- | quantum/template/config.h | 47 | ||||
| -rw-r--r-- | tmk_core/common/command.c | 353 | ||||
| -rw-r--r-- | tmk_core/common/command.h | 121 | ||||
| -rw-r--r-- | tmk_core/common/keyboard.c | 6 |
7 files changed, 488 insertions, 132 deletions
diff --git a/keyboard/retro_refit/Makefile b/keyboard/retro_refit/Makefile index ec51227ff..918b43071 100644 --- a/keyboard/retro_refit/Makefile +++ b/keyboard/retro_refit/Makefile | |||
| @@ -113,18 +113,19 @@ OPT_DEFS += -DBOOTLOADER_SIZE=512 | |||
| 113 | # Build Options | 113 | # Build Options |
| 114 | # comment out to disable the options. | 114 | # comment out to disable the options. |
| 115 | # | 115 | # |
| 116 | BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) | 116 | BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) |
| 117 | MOUSEKEY_ENABLE = yes # Mouse keys(+4700) | 117 | MOUSEKEY_ENABLE = yes # Mouse keys(+4700) |
| 118 | EXTRAKEY_ENABLE = yes # Audio control and System control(+450) | 118 | EXTRAKEY_ENABLE = yes # Audio control and System control(+450) |
| 119 | CONSOLE_ENABLE = yes # Console for debug(+400) | 119 | CONSOLE_ENABLE = yes # Console for debug(+400) |
| 120 | COMMAND_ENABLE = yes # Commands for debug and configuration | 120 | COMMAND_ENABLE = yes # Commands for debug and configuration |
| 121 | KEYBOARD_LOCK_ENABLE = yes # Allow locking of keyboard via magic key | ||
| 121 | # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE | 122 | # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE |
| 122 | # SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend | 123 | # SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend |
| 123 | # NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work | 124 | NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work |
| 124 | # BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality | 125 | # BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality |
| 125 | # MIDI_ENABLE = YES # MIDI controls | 126 | # MIDI_ENABLE = YES # MIDI controls |
| 126 | # UNICODE_ENABLE = YES # Unicode | 127 | # UNICODE_ENABLE = YES # Unicode |
| 127 | # BLUETOOTH_ENABLE = yes # Enable Bluetooth with the Adafruit EZ-Key HID | 128 | # BLUETOOTH_ENABLE = yes # Enable Bluetooth with the Adafruit EZ-Key HID |
| 128 | 129 | ||
| 129 | 130 | ||
| 130 | # Optimize size but this may cause error "relocation truncated to fit" | 131 | # Optimize size but this may cause error "relocation truncated to fit" |
diff --git a/keyboard/retro_refit/config.h b/keyboard/retro_refit/config.h index ba9a861ed..05fceb92b 100644 --- a/keyboard/retro_refit/config.h +++ b/keyboard/retro_refit/config.h | |||
| @@ -53,11 +53,54 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 53 | /* Locking resynchronize hack */ | 53 | /* Locking resynchronize hack */ |
| 54 | #define LOCKING_RESYNC_ENABLE | 54 | #define LOCKING_RESYNC_ENABLE |
| 55 | 55 | ||
| 56 | /* key combination for command */ | 56 | |
| 57 | /* Force NKRO Mode - If forced on, must be disabled via magic key (default = LShift+RShift+N) */ | ||
| 58 | #define FORCE_NKRO | ||
| 59 | |||
| 60 | /* | ||
| 61 | * Magic key options | ||
| 62 | * These options allow the magic key functionality to be changed. This is useful | ||
| 63 | * if your keyboard/keypad is missing keys and you want magic key support. | ||
| 64 | */ | ||
| 65 | |||
| 66 | /* key combination for magic key command */ | ||
| 57 | #define IS_COMMAND() ( \ | 67 | #define IS_COMMAND() ( \ |
| 58 | keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ | 68 | keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ |
| 59 | ) | 69 | ) |
| 60 | 70 | ||
| 71 | /* control how magic key switches layers */ | ||
| 72 | //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true | ||
| 73 | //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true | ||
| 74 | //#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false | ||
| 75 | |||
| 76 | /* remap magic keys */ | ||
| 77 | //#define MAGIC_KEY_HELP1 H | ||
| 78 | //#define MAGIC_KEY_HELP2 SLASH | ||
| 79 | //#define MAGIC_KEY_DEBUG D | ||
| 80 | //#define MAGIC_KEY_DEBUG_MATRIX X | ||
| 81 | //#define MAGIC_KEY_DEBUG_KBD K | ||
| 82 | //#define MAGIC_KEY_DEBUG_MOUSE M | ||
| 83 | //#define MAGIC_KEY_VERSION V | ||
| 84 | //#define MAGIC_KEY_STATUS S | ||
| 85 | //#define MAGIC_KEY_CONSOLE C | ||
| 86 | //#define MAGIC_KEY_LAYER0_ALT1 ESC | ||
| 87 | //#define MAGIC_KEY_LAYER0_ALT2 GRAVE | ||
| 88 | //#define MAGIC_KEY_LAYER0 0 | ||
| 89 | //#define MAGIC_KEY_LAYER1 1 | ||
| 90 | //#define MAGIC_KEY_LAYER2 2 | ||
| 91 | //#define MAGIC_KEY_LAYER3 3 | ||
| 92 | //#define MAGIC_KEY_LAYER4 4 | ||
| 93 | //#define MAGIC_KEY_LAYER5 5 | ||
| 94 | //#define MAGIC_KEY_LAYER6 6 | ||
| 95 | //#define MAGIC_KEY_LAYER7 7 | ||
| 96 | //#define MAGIC_KEY_LAYER8 8 | ||
| 97 | //#define MAGIC_KEY_LAYER9 9 | ||
| 98 | //#define MAGIC_KEY_BOOTLOADER PAUSE | ||
| 99 | #define MAGIC_KEY_LOCK BSLS | ||
| 100 | //#define MAGIC_KEY_EEPROM E | ||
| 101 | //#define MAGIC_KEY_NKRO N | ||
| 102 | //#define MAGIC_KEY_SLEEP_LED Z | ||
| 103 | |||
| 61 | /* | 104 | /* |
| 62 | * Feature disable options | 105 | * Feature disable options |
| 63 | * These options are also useful to firmware size reduction. | 106 | * These options are also useful to firmware size reduction. |
| @@ -76,4 +119,4 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 76 | //#define NO_ACTION_MACRO | 119 | //#define NO_ACTION_MACRO |
| 77 | //#define NO_ACTION_FUNCTION | 120 | //#define NO_ACTION_FUNCTION |
| 78 | 121 | ||
| 79 | #endif | 122 | #endif \ No newline at end of file |
diff --git a/quantum/template/Makefile b/quantum/template/Makefile index 2efa69138..4fa195468 100644 --- a/quantum/template/Makefile +++ b/quantum/template/Makefile | |||
| @@ -113,18 +113,19 @@ OPT_DEFS += -DBOOTLOADER_SIZE=512 | |||
| 113 | # Build Options | 113 | # Build Options |
| 114 | # comment out to disable the options. | 114 | # comment out to disable the options. |
| 115 | # | 115 | # |
| 116 | BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) | 116 | BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) |
| 117 | MOUSEKEY_ENABLE = yes # Mouse keys(+4700) | 117 | MOUSEKEY_ENABLE = yes # Mouse keys(+4700) |
| 118 | EXTRAKEY_ENABLE = yes # Audio control and System control(+450) | 118 | EXTRAKEY_ENABLE = yes # Audio control and System control(+450) |
| 119 | CONSOLE_ENABLE = yes # Console for debug(+400) | 119 | CONSOLE_ENABLE = yes # Console for debug(+400) |
| 120 | COMMAND_ENABLE = yes # Commands for debug and configuration | 120 | COMMAND_ENABLE = yes # Commands for debug and configuration |
| 121 | KEYBOARD_LOCK_ENABLE = yes # Allow locking of keyboard via magic key | ||
| 121 | # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE | 122 | # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE |
| 122 | # SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend | 123 | # SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend |
| 123 | # NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work | 124 | #NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work |
| 124 | # BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality | 125 | # BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality |
| 125 | # MIDI_ENABLE = YES # MIDI controls | 126 | # MIDI_ENABLE = YES # MIDI controls |
| 126 | # UNICODE_ENABLE = YES # Unicode | 127 | # UNICODE_ENABLE = YES # Unicode |
| 127 | # BLUETOOTH_ENABLE = yes # Enable Bluetooth with the Adafruit EZ-Key HID | 128 | # BLUETOOTH_ENABLE = yes # Enable Bluetooth with the Adafruit EZ-Key HID |
| 128 | 129 | ||
| 129 | 130 | ||
| 130 | # Optimize size but this may cause error "relocation truncated to fit" | 131 | # Optimize size but this may cause error "relocation truncated to fit" |
diff --git a/quantum/template/config.h b/quantum/template/config.h index 7d6149f43..dae4b6313 100644 --- a/quantum/template/config.h +++ b/quantum/template/config.h | |||
| @@ -55,11 +55,56 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 55 | /* Locking resynchronize hack */ | 55 | /* Locking resynchronize hack */ |
| 56 | #define LOCKING_RESYNC_ENABLE | 56 | #define LOCKING_RESYNC_ENABLE |
| 57 | 57 | ||
| 58 | /* key combination for command */ | 58 | /* Force NKRO Mode - If forced on, must be disabled via magic key (default = LShift+RShift+N) */ |
| 59 | //#define FORCE_NKRO | ||
| 60 | |||
| 61 | /* | ||
| 62 | * Magic key options | ||
| 63 | * These options allow the magic key functionality to be changed. This is useful | ||
| 64 | * if your keyboard/keypad is missing keys and you want magic key support. | ||
| 65 | */ | ||
| 66 | |||
| 67 | /* key combination for magic key command */ | ||
| 59 | #define IS_COMMAND() ( \ | 68 | #define IS_COMMAND() ( \ |
| 60 | keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ | 69 | keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ |
| 61 | ) | 70 | ) |
| 62 | 71 | ||
| 72 | /* control how magic key switches layers */ | ||
| 73 | //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true | ||
| 74 | //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true | ||
| 75 | //#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false | ||
| 76 | |||
| 77 | /* override magic key keymap */ | ||
| 78 | //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS | ||
| 79 | //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS | ||
| 80 | //#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM | ||
| 81 | //#define MAGIC_KEY_HELP1 H | ||
| 82 | //#define MAGIC_KEY_HELP2 SLASH | ||
| 83 | //#define MAGIC_KEY_DEBUG D | ||
| 84 | //#define MAGIC_KEY_DEBUG_MATRIX X | ||
| 85 | //#define MAGIC_KEY_DEBUG_KBD K | ||
| 86 | //#define MAGIC_KEY_DEBUG_MOUSE M | ||
| 87 | //#define MAGIC_KEY_VERSION V | ||
| 88 | //#define MAGIC_KEY_STATUS S | ||
| 89 | //#define MAGIC_KEY_CONSOLE C | ||
| 90 | //#define MAGIC_KEY_LAYER0_ALT1 ESC | ||
| 91 | //#define MAGIC_KEY_LAYER0_ALT2 GRAVE | ||
| 92 | //#define MAGIC_KEY_LAYER0 0 | ||
| 93 | //#define MAGIC_KEY_LAYER1 1 | ||
| 94 | //#define MAGIC_KEY_LAYER2 2 | ||
| 95 | //#define MAGIC_KEY_LAYER3 3 | ||
| 96 | //#define MAGIC_KEY_LAYER4 4 | ||
| 97 | //#define MAGIC_KEY_LAYER5 5 | ||
| 98 | //#define MAGIC_KEY_LAYER6 6 | ||
| 99 | //#define MAGIC_KEY_LAYER7 7 | ||
| 100 | //#define MAGIC_KEY_LAYER8 8 | ||
| 101 | //#define MAGIC_KEY_LAYER9 9 | ||
| 102 | //#define MAGIC_KEY_BOOTLOADER PAUSE | ||
| 103 | //#define MAGIC_KEY_LOCK CAPS | ||
| 104 | //#define MAGIC_KEY_EEPROM E | ||
| 105 | //#define MAGIC_KEY_NKRO N | ||
| 106 | //#define MAGIC_KEY_SLEEP_LED Z | ||
| 107 | |||
| 63 | /* | 108 | /* |
| 64 | * Feature disable options | 109 | * Feature disable options |
| 65 | * These options are also useful to firmware size reduction. | 110 | * These options are also useful to firmware size reduction. |
diff --git a/tmk_core/common/command.c b/tmk_core/common/command.c index d59bb01bb..b4cd3ca56 100644 --- a/tmk_core/common/command.c +++ b/tmk_core/common/command.c | |||
| @@ -52,6 +52,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 52 | 52 | ||
| 53 | static bool command_common(uint8_t code); | 53 | static bool command_common(uint8_t code); |
| 54 | static void command_common_help(void); | 54 | static void command_common_help(void); |
| 55 | static void print_version(void); | ||
| 56 | static void print_status(void); | ||
| 55 | static bool command_console(uint8_t code); | 57 | static bool command_console(uint8_t code); |
| 56 | static void command_console_help(void); | 58 | static void command_console_help(void); |
| 57 | #ifdef MOUSEKEY_ENABLE | 59 | #ifdef MOUSEKEY_ENABLE |
| @@ -112,35 +114,140 @@ bool command_console_extra(uint8_t code) | |||
| 112 | ***********************************************************/ | 114 | ***********************************************************/ |
| 113 | static void command_common_help(void) | 115 | static void command_common_help(void) |
| 114 | { | 116 | { |
| 115 | print("\n\t- Magic -\n" | 117 | print( "\n\t- Magic -\n" |
| 116 | "d: debug\n" | 118 | STR(MAGIC_KEY_DEBUG ) ": Debug Message Toggle\n" |
| 117 | "x: debug matrix\n" | 119 | STR(MAGIC_KEY_DEBUG_MATRIX) ": Matrix Debug Mode Toggle - Show keypresses in matrix grid\n" |
| 118 | "k: debug keyboard\n" | 120 | STR(MAGIC_KEY_DEBUG_KBD ) ": Keyboard Debug Toggle - Show keypress report\n" |
| 119 | "m: debug mouse\n" | 121 | STR(MAGIC_KEY_DEBUG_MOUSE ) ": Debug Mouse Toggle\n" |
| 120 | "v: version\n" | 122 | STR(MAGIC_KEY_VERSION ) ": Version\n" |
| 121 | "s: status\n" | 123 | STR(MAGIC_KEY_STATUS ) ": Status\n" |
| 122 | "c: console mode\n" | 124 | STR(MAGIC_KEY_CONSOLE ) ": Activate Console Mode\n" |
| 123 | "0-4: layer0-4(F10-F4)\n" | 125 | |
| 124 | "Paus: bootloader\n" | 126 | #if MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM |
| 127 | STR(MAGIC_KEY_LAYER0 ) ": Switch to Layer 0\n" | ||
| 128 | STR(MAGIC_KEY_LAYER1 ) ": Switch to Layer 1\n" | ||
| 129 | STR(MAGIC_KEY_LAYER2 ) ": Switch to Layer 2\n" | ||
| 130 | STR(MAGIC_KEY_LAYER3 ) ": Switch to Layer 3\n" | ||
| 131 | STR(MAGIC_KEY_LAYER4 ) ": Switch to Layer 4\n" | ||
| 132 | STR(MAGIC_KEY_LAYER5 ) ": Switch to Layer 5\n" | ||
| 133 | STR(MAGIC_KEY_LAYER6 ) ": Switch to Layer 6\n" | ||
| 134 | STR(MAGIC_KEY_LAYER7 ) ": Switch to Layer 7\n" | ||
| 135 | STR(MAGIC_KEY_LAYER8 ) ": Switch to Layer 8\n" | ||
| 136 | STR(MAGIC_KEY_LAYER9 ) ": Switch to Layer 9\n" | ||
| 137 | #endif | ||
| 138 | |||
| 139 | #if MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS | ||
| 140 | "F1-F10: Switch to Layer 0-9 (F10 = L0)\n" | ||
| 141 | #endif | ||
| 142 | |||
| 143 | #if MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS | ||
| 144 | "0-9: Switch to Layer 0-9\n" | ||
| 145 | #endif | ||
| 146 | |||
| 147 | STR(MAGIC_KEY_LAYER0_ALT1 ) ": Switch to Layer 0 (alternate key 1)\n" | ||
| 148 | STR(MAGIC_KEY_LAYER0_ALT2 ) ": Switch to Layer 0 (alternate key 2)\n" | ||
| 149 | STR(MAGIC_KEY_BOOTLOADER ) ": Jump to Bootloader (Reset)\n" | ||
| 125 | 150 | ||
| 126 | #ifdef KEYBOARD_LOCK_ENABLE | 151 | #ifdef KEYBOARD_LOCK_ENABLE |
| 127 | "Caps: Lock\n" | 152 | STR(MAGIC_KEY_LOCK ) ": Lock\n" |
| 128 | #endif | 153 | #endif |
| 129 | 154 | ||
| 130 | #ifdef BOOTMAGIC_ENABLE | 155 | #ifdef BOOTMAGIC_ENABLE |
| 131 | "e: eeprom\n" | 156 | STR(MAGIC_KEY_EEPROM ) ": Print EEPROM Settings\n" |
| 132 | #endif | 157 | #endif |
| 133 | 158 | ||
| 134 | #ifdef NKRO_ENABLE | 159 | #ifdef NKRO_ENABLE |
| 135 | "n: NKRO\n" | 160 | STR(MAGIC_KEY_NKRO ) ": NKRO Toggle\n" |
| 136 | #endif | 161 | #endif |
| 137 | 162 | ||
| 138 | #ifdef SLEEP_LED_ENABLE | 163 | #ifdef SLEEP_LED_ENABLE |
| 139 | "z: sleep LED test\n" | 164 | STR(MAGIC_KEY_SLEEP_LED ) ": Sleep LED Test\n" |
| 140 | #endif | 165 | #endif |
| 141 | ); | 166 | ); |
| 142 | } | 167 | } |
| 143 | 168 | ||
| 169 | static void print_version(void) | ||
| 170 | { | ||
| 171 | // print version & information | ||
| 172 | print("\n\t- Version -\n"); | ||
| 173 | print("DESC: " STR(DESCRIPTION) "\n"); | ||
| 174 | print("VID: " STR(VENDOR_ID) "(" STR(MANUFACTURER) ") " | ||
| 175 | "PID: " STR(PRODUCT_ID) "(" STR(PRODUCT) ") " | ||
| 176 | "VER: " STR(DEVICE_VER) "\n"); | ||
| 177 | print("BUILD: " STR(VERSION) " (" __TIME__ " " __DATE__ ")\n"); | ||
| 178 | |||
| 179 | /* build options */ | ||
| 180 | print("OPTIONS:" | ||
| 181 | |||
| 182 | #ifdef PROTOCOL_PJRC | ||
| 183 | " PJRC" | ||
| 184 | #endif | ||
| 185 | #ifdef PROTOCOL_LUFA | ||
| 186 | " LUFA" | ||
| 187 | #endif | ||
| 188 | #ifdef PROTOCOL_VUSB | ||
| 189 | " VUSB" | ||
| 190 | #endif | ||
| 191 | #ifdef BOOTMAGIC_ENABLE | ||
| 192 | " BOOTMAGIC" | ||
| 193 | #endif | ||
| 194 | #ifdef MOUSEKEY_ENABLE | ||
| 195 | " MOUSEKEY" | ||
| 196 | #endif | ||
| 197 | #ifdef EXTRAKEY_ENABLE | ||
| 198 | " EXTRAKEY" | ||
| 199 | #endif | ||
| 200 | #ifdef CONSOLE_ENABLE | ||
| 201 | " CONSOLE" | ||
| 202 | #endif | ||
| 203 | #ifdef COMMAND_ENABLE | ||
| 204 | " COMMAND" | ||
| 205 | #endif | ||
| 206 | #ifdef NKRO_ENABLE | ||
| 207 | " NKRO" | ||
| 208 | #endif | ||
| 209 | #ifdef KEYMAP_SECTION_ENABLE | ||
| 210 | " KEYMAP_SECTION" | ||
| 211 | #endif | ||
| 212 | |||
| 213 | " " STR(BOOTLOADER_SIZE) "\n"); | ||
| 214 | |||
| 215 | print("GCC: " STR(__GNUC__) "." STR(__GNUC_MINOR__) "." STR(__GNUC_PATCHLEVEL__) | ||
| 216 | " AVR-LIBC: " __AVR_LIBC_VERSION_STRING__ | ||
| 217 | " AVR_ARCH: avr" STR(__AVR_ARCH__) "\n"); | ||
| 218 | |||
| 219 | return; | ||
| 220 | } | ||
| 221 | |||
| 222 | static void print_status(void) | ||
| 223 | { | ||
| 224 | |||
| 225 | print("\n\t- Status -\n"); | ||
| 226 | |||
| 227 | print_val_hex8(host_keyboard_leds()); | ||
| 228 | print_val_hex8(keyboard_protocol); | ||
| 229 | print_val_hex8(keyboard_idle); | ||
| 230 | #ifdef NKRO_ENABLE | ||
| 231 | print_val_hex8(keyboard_nkro); | ||
| 232 | #endif | ||
| 233 | print_val_hex32(timer_count); | ||
| 234 | |||
| 235 | #ifdef PROTOCOL_PJRC | ||
| 236 | print_val_hex8(UDCON); | ||
| 237 | print_val_hex8(UDIEN); | ||
| 238 | print_val_hex8(UDINT); | ||
| 239 | print_val_hex8(usb_keyboard_leds); | ||
| 240 | print_val_hex8(usb_keyboard_idle_count); | ||
| 241 | #endif | ||
| 242 | |||
| 243 | #ifdef PROTOCOL_PJRC | ||
| 244 | # if USB_COUNT_SOF | ||
| 245 | print_val_hex8(usbSofCount); | ||
| 246 | # endif | ||
| 247 | #endif | ||
| 248 | return; | ||
| 249 | } | ||
| 250 | |||
| 144 | #ifdef BOOTMAGIC_ENABLE | 251 | #ifdef BOOTMAGIC_ENABLE |
| 145 | static void print_eeconfig(void) | 252 | static void print_eeconfig(void) |
| 146 | { | 253 | { |
| @@ -178,24 +285,36 @@ static void print_eeconfig(void) | |||
| 178 | 285 | ||
| 179 | static bool command_common(uint8_t code) | 286 | static bool command_common(uint8_t code) |
| 180 | { | 287 | { |
| 288 | |||
| 289 | #ifdef KEYBOARD_LOCK_ENABLE | ||
| 181 | static host_driver_t *host_driver = 0; | 290 | static host_driver_t *host_driver = 0; |
| 291 | #endif | ||
| 292 | |||
| 182 | switch (code) { | 293 | switch (code) { |
| 294 | |||
| 183 | #ifdef SLEEP_LED_ENABLE | 295 | #ifdef SLEEP_LED_ENABLE |
| 184 | case KC_Z: | 296 | |
| 185 | // test breathing sleep LED | 297 | // test breathing sleep LED |
| 186 | print("Sleep LED test\n"); | 298 | case MAGIC_KC(MAGIC_KEY_SLEEP_LED): |
| 299 | print("Sleep LED Test\n"); | ||
| 187 | sleep_led_toggle(); | 300 | sleep_led_toggle(); |
| 188 | led_set(host_keyboard_leds()); | 301 | led_set(host_keyboard_leds()); |
| 189 | break; | 302 | break; |
| 190 | #endif | 303 | #endif |
| 304 | |||
| 191 | #ifdef BOOTMAGIC_ENABLE | 305 | #ifdef BOOTMAGIC_ENABLE |
| 192 | case KC_E: | 306 | |
| 307 | // print stored eeprom config | ||
| 308 | case MAGIC_KC(MAGIC_KEY_EEPROM): | ||
| 193 | print("eeconfig:\n"); | 309 | print("eeconfig:\n"); |
| 194 | print_eeconfig(); | 310 | print_eeconfig(); |
| 195 | break; | 311 | break; |
| 196 | #endif | 312 | #endif |
| 313 | |||
| 197 | #ifdef KEYBOARD_LOCK_ENABLE | 314 | #ifdef KEYBOARD_LOCK_ENABLE |
| 198 | case KC_CAPSLOCK: | 315 | |
| 316 | // lock/unlock keyboard | ||
| 317 | case MAGIC_KC(MAGIC_KEY_LOCK): | ||
| 199 | if (host_get_driver()) { | 318 | if (host_get_driver()) { |
| 200 | host_driver = host_get_driver(); | 319 | host_driver = host_get_driver(); |
| 201 | clear_keyboard(); | 320 | clear_keyboard(); |
| @@ -207,11 +326,15 @@ static bool command_common(uint8_t code) | |||
| 207 | } | 326 | } |
| 208 | break; | 327 | break; |
| 209 | #endif | 328 | #endif |
| 210 | case KC_H: | 329 | |
| 211 | case KC_SLASH: /* ? */ | 330 | // print help |
| 331 | case MAGIC_KC(MAGIC_KEY_HELP1): | ||
| 332 | case MAGIC_KC(MAGIC_KEY_HELP2): | ||
| 212 | command_common_help(); | 333 | command_common_help(); |
| 213 | break; | 334 | break; |
| 214 | case KC_C: | 335 | |
| 336 | // activate console | ||
| 337 | case MAGIC_KC(MAGIC_KEY_CONSOLE): | ||
| 215 | debug_matrix = false; | 338 | debug_matrix = false; |
| 216 | debug_keyboard = false; | 339 | debug_keyboard = false; |
| 217 | debug_mouse = false; | 340 | debug_mouse = false; |
| @@ -220,25 +343,33 @@ static bool command_common(uint8_t code) | |||
| 220 | print("C> "); | 343 | print("C> "); |
| 221 | command_state = CONSOLE; | 344 | command_state = CONSOLE; |
| 222 | break; | 345 | break; |
| 223 | case KC_PAUSE: | 346 | |
| 224 | clear_keyboard(); | 347 | // jump to bootloader |
| 225 | print("\n\nbootloader... "); | 348 | case MAGIC_KC(MAGIC_KEY_BOOTLOADER): |
| 349 | clear_keyboard(); // clear to prevent stuck keys | ||
| 350 | print("\n\nJumping to bootloader... "); | ||
| 226 | _delay_ms(1000); | 351 | _delay_ms(1000); |
| 227 | bootloader_jump(); // not return | 352 | bootloader_jump(); // not return |
| 228 | break; | 353 | break; |
| 229 | case KC_D: | 354 | |
| 355 | // debug toggle | ||
| 356 | case MAGIC_KC(MAGIC_KEY_DEBUG): | ||
| 357 | debug_enable = !debug_enable; | ||
| 230 | if (debug_enable) { | 358 | if (debug_enable) { |
| 359 | print("\ndebug: on\n"); | ||
| 360 | debug_matrix = true; | ||
| 361 | debug_keyboard = true; | ||
| 362 | debug_mouse = true; | ||
| 363 | } else { | ||
| 231 | print("\ndebug: off\n"); | 364 | print("\ndebug: off\n"); |
| 232 | debug_matrix = false; | 365 | debug_matrix = false; |
| 233 | debug_keyboard = false; | 366 | debug_keyboard = false; |
| 234 | debug_mouse = false; | 367 | debug_mouse = false; |
| 235 | debug_enable = false; | ||
| 236 | } else { | ||
| 237 | print("\ndebug: on\n"); | ||
| 238 | debug_enable = true; | ||
| 239 | } | 368 | } |
| 240 | break; | 369 | break; |
| 241 | case KC_X: // debug matrix toggle | 370 | |
| 371 | // debug matrix toggle | ||
| 372 | case MAGIC_KC(MAGIC_KEY_DEBUG_MATRIX): | ||
| 242 | debug_matrix = !debug_matrix; | 373 | debug_matrix = !debug_matrix; |
| 243 | if (debug_matrix) { | 374 | if (debug_matrix) { |
| 244 | print("\nmatrix: on\n"); | 375 | print("\nmatrix: on\n"); |
| @@ -247,7 +378,9 @@ static bool command_common(uint8_t code) | |||
| 247 | print("\nmatrix: off\n"); | 378 | print("\nmatrix: off\n"); |
| 248 | } | 379 | } |
| 249 | break; | 380 | break; |
| 250 | case KC_K: // debug keyboard toggle | 381 | |
| 382 | // debug keyboard toggle | ||
| 383 | case MAGIC_KC(MAGIC_KEY_DEBUG_KBD): | ||
| 251 | debug_keyboard = !debug_keyboard; | 384 | debug_keyboard = !debug_keyboard; |
| 252 | if (debug_keyboard) { | 385 | if (debug_keyboard) { |
| 253 | print("\nkeyboard: on\n"); | 386 | print("\nkeyboard: on\n"); |
| @@ -256,87 +389,33 @@ static bool command_common(uint8_t code) | |||
| 256 | print("\nkeyboard: off\n"); | 389 | print("\nkeyboard: off\n"); |
| 257 | } | 390 | } |
| 258 | break; | 391 | break; |
| 259 | case KC_M: // debug mouse toggle | 392 | |
| 393 | // debug mouse toggle | ||
| 394 | case MAGIC_KC(MAGIC_KEY_DEBUG_MOUSE): | ||
| 260 | debug_mouse = !debug_mouse; | 395 | debug_mouse = !debug_mouse; |
| 261 | if (debug_mouse) { | 396 | if (debug_mouse) { |
| 262 | print("\nmouse: on\n"); | 397 | print("\nmouse: on\n"); |
| 263 | debug_enable = true; | 398 | debug_enable = true; |
| 264 | } else { | 399 | } else { |
| 265 | print("\nmouse: off\n"); | 400 | print("\nmouse: off\n"); |
| 266 | } | 401 | } |
| 267 | break; | 402 | break; |
| 268 | case KC_V: // print version & information | ||
| 269 | print("\n\t- Version -\n"); | ||
| 270 | print("DESC: " STR(DESCRIPTION) "\n"); | ||
| 271 | print("VID: " STR(VENDOR_ID) "(" STR(MANUFACTURER) ") " | ||
| 272 | "PID: " STR(PRODUCT_ID) "(" STR(PRODUCT) ") " | ||
| 273 | "VER: " STR(DEVICE_VER) "\n"); | ||
| 274 | print("BUILD: " STR(VERSION) " (" __TIME__ " " __DATE__ ")\n"); | ||
| 275 | /* build options */ | ||
| 276 | print("OPTIONS:" | ||
| 277 | #ifdef PROTOCOL_PJRC | ||
| 278 | " PJRC" | ||
| 279 | #endif | ||
| 280 | #ifdef PROTOCOL_LUFA | ||
| 281 | " LUFA" | ||
| 282 | #endif | ||
| 283 | #ifdef PROTOCOL_VUSB | ||
| 284 | " VUSB" | ||
| 285 | #endif | ||
| 286 | #ifdef BOOTMAGIC_ENABLE | ||
| 287 | " BOOTMAGIC" | ||
| 288 | #endif | ||
| 289 | #ifdef MOUSEKEY_ENABLE | ||
| 290 | " MOUSEKEY" | ||
| 291 | #endif | ||
| 292 | #ifdef EXTRAKEY_ENABLE | ||
| 293 | " EXTRAKEY" | ||
| 294 | #endif | ||
| 295 | #ifdef CONSOLE_ENABLE | ||
| 296 | " CONSOLE" | ||
| 297 | #endif | ||
| 298 | #ifdef COMMAND_ENABLE | ||
| 299 | " COMMAND" | ||
| 300 | #endif | ||
| 301 | #ifdef NKRO_ENABLE | ||
| 302 | " NKRO" | ||
| 303 | #endif | ||
| 304 | #ifdef KEYMAP_SECTION_ENABLE | ||
| 305 | " KEYMAP_SECTION" | ||
| 306 | #endif | ||
| 307 | " " STR(BOOTLOADER_SIZE) "\n"); | ||
| 308 | 403 | ||
| 309 | print("GCC: " STR(__GNUC__) "." STR(__GNUC_MINOR__) "." STR(__GNUC_PATCHLEVEL__) | 404 | // print version |
| 310 | " AVR-LIBC: " __AVR_LIBC_VERSION_STRING__ | 405 | case MAGIC_KC(MAGIC_KEY_VERSION): |
| 311 | " AVR_ARCH: avr" STR(__AVR_ARCH__) "\n"); | 406 | print_version(); |
| 312 | break; | 407 | break; |
| 313 | case KC_S: | ||
| 314 | print("\n\t- Status -\n"); | ||
| 315 | print_val_hex8(host_keyboard_leds()); | ||
| 316 | print_val_hex8(keyboard_protocol); | ||
| 317 | print_val_hex8(keyboard_idle); | ||
| 318 | #ifdef NKRO_ENABLE | ||
| 319 | print_val_hex8(keyboard_nkro); | ||
| 320 | #endif | ||
| 321 | print_val_hex32(timer_count); | ||
| 322 | |||
| 323 | #ifdef PROTOCOL_PJRC | ||
| 324 | print_val_hex8(UDCON); | ||
| 325 | print_val_hex8(UDIEN); | ||
| 326 | print_val_hex8(UDINT); | ||
| 327 | print_val_hex8(usb_keyboard_leds); | ||
| 328 | print_val_hex8(usb_keyboard_idle_count); | ||
| 329 | #endif | ||
| 330 | 408 | ||
| 331 | #ifdef PROTOCOL_PJRC | 409 | // print status |
| 332 | # if USB_COUNT_SOF | 410 | case MAGIC_KC(MAGIC_KEY_STATUS): |
| 333 | print_val_hex8(usbSofCount); | 411 | print_status(); |
| 334 | # endif | ||
| 335 | #endif | ||
| 336 | break; | 412 | break; |
| 413 | |||
| 337 | #ifdef NKRO_ENABLE | 414 | #ifdef NKRO_ENABLE |
| 338 | case KC_N: | 415 | |
| 339 | clear_keyboard(); //Prevents stuck keys. | 416 | // NKRO toggle |
| 417 | case MAGIC_KC(MAGIC_KEY_NKRO): | ||
| 418 | clear_keyboard(); // clear to prevent stuck keys | ||
| 340 | keyboard_nkro = !keyboard_nkro; | 419 | keyboard_nkro = !keyboard_nkro; |
| 341 | if (keyboard_nkro) | 420 | if (keyboard_nkro) |
| 342 | print("NKRO: on\n"); | 421 | print("NKRO: on\n"); |
| @@ -344,18 +423,78 @@ static bool command_common(uint8_t code) | |||
| 344 | print("NKRO: off\n"); | 423 | print("NKRO: off\n"); |
| 345 | break; | 424 | break; |
| 346 | #endif | 425 | #endif |
| 347 | case KC_ESC: | 426 | |
| 348 | case KC_GRV: | 427 | // switch layers |
| 349 | case KC_0: | 428 | |
| 429 | case MAGIC_KC(MAGIC_KEY_LAYER0_ALT1): | ||
| 430 | case MAGIC_KC(MAGIC_KEY_LAYER0_ALT2): | ||
| 431 | switch_default_layer(0); | ||
| 432 | break; | ||
| 433 | |||
| 434 | #if MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM | ||
| 435 | |||
| 436 | case MAGIC_KC(MAGIC_KEY_LAYER0): | ||
| 437 | switch_default_layer(0); | ||
| 438 | break; | ||
| 439 | |||
| 440 | case MAGIC_KC(MAGIC_KEY_LAYER1): | ||
| 441 | switch_default_layer(1); | ||
| 442 | break; | ||
| 443 | |||
| 444 | case MAGIC_KC(MAGIC_KEY_LAYER2): | ||
| 445 | switch_default_layer(2); | ||
| 446 | break; | ||
| 447 | |||
| 448 | case MAGIC_KC(MAGIC_KEY_LAYER3): | ||
| 449 | switch_default_layer(3); | ||
| 450 | break; | ||
| 451 | |||
| 452 | case MAGIC_KC(MAGIC_KEY_LAYER4): | ||
| 453 | switch_default_layer(4); | ||
| 454 | break; | ||
| 455 | |||
| 456 | case MAGIC_KC(MAGIC_KEY_LAYER5): | ||
| 457 | switch_default_layer(5); | ||
| 458 | break; | ||
| 459 | |||
| 460 | case MAGIC_KC(MAGIC_KEY_LAYER6): | ||
| 461 | switch_default_layer(6); | ||
| 462 | break; | ||
| 463 | |||
| 464 | case MAGIC_KC(MAGIC_KEY_LAYER7): | ||
| 465 | switch_default_layer(7); | ||
| 466 | break; | ||
| 467 | |||
| 468 | case MAGIC_KC(MAGIC_KEY_LAYER8): | ||
| 469 | switch_default_layer(8); | ||
| 470 | break; | ||
| 471 | |||
| 472 | case MAGIC_KC(MAGIC_KEY_LAYER9): | ||
| 473 | switch_default_layer(9); | ||
| 474 | break; | ||
| 475 | #endif | ||
| 476 | |||
| 477 | |||
| 478 | #if MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS | ||
| 479 | |||
| 480 | case KC_F1 ... KC_F9: | ||
| 481 | switch_default_layer((code - KC_F1) + 1); | ||
| 482 | break; | ||
| 350 | case KC_F10: | 483 | case KC_F10: |
| 351 | switch_default_layer(0); | 484 | switch_default_layer(0); |
| 352 | break; | 485 | break; |
| 486 | #endif | ||
| 487 | |||
| 488 | #if MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS | ||
| 489 | |||
| 353 | case KC_1 ... KC_9: | 490 | case KC_1 ... KC_9: |
| 354 | switch_default_layer((code - KC_1) + 1); | 491 | switch_default_layer((code - KC_1) + 1); |
| 355 | break; | 492 | break; |
| 356 | case KC_F1 ... KC_F9: | 493 | case KC_0: |
| 357 | switch_default_layer((code - KC_F1) + 1); | 494 | switch_default_layer(0); |
| 358 | break; | 495 | break; |
| 496 | #endif | ||
| 497 | |||
| 359 | default: | 498 | default: |
| 360 | print("?"); | 499 | print("?"); |
| 361 | return false; | 500 | return false; |
diff --git a/tmk_core/common/command.h b/tmk_core/common/command.h index b57a6c1ce..92b18849b 100644 --- a/tmk_core/common/command.h +++ b/tmk_core/common/command.h | |||
| @@ -32,4 +32,125 @@ bool command_proc(uint8_t code); | |||
| 32 | #define command_proc(code) false | 32 | #define command_proc(code) false |
| 33 | #endif | 33 | #endif |
| 34 | 34 | ||
| 35 | |||
| 36 | #ifndef MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS | ||
| 37 | #define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true | ||
| 38 | #endif | ||
| 39 | |||
| 40 | #ifndef MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS | ||
| 41 | #define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true | ||
| 42 | #endif | ||
| 43 | |||
| 44 | #ifndef MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM | ||
| 45 | #define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false | ||
| 46 | #endif | ||
| 47 | |||
| 48 | #ifndef MAGIC_KEY_HELP1 | ||
| 49 | #define MAGIC_KEY_HELP1 H | ||
| 50 | #endif | ||
| 51 | |||
| 52 | #ifndef MAGIC_KEY_HELP2 | ||
| 53 | #define MAGIC_KEY_HELP2 SLASH | ||
| 54 | #endif | ||
| 55 | |||
| 56 | #ifndef MAGIC_KEY_DEBUG | ||
| 57 | #define MAGIC_KEY_DEBUG D | ||
| 58 | #endif | ||
| 59 | |||
| 60 | #ifndef MAGIC_KEY_DEBUG_MATRIX | ||
| 61 | #define MAGIC_KEY_DEBUG_MATRIX X | ||
| 62 | #endif | ||
| 63 | |||
| 64 | #ifndef MAGIC_KEY_DEBUG_KBD | ||
| 65 | #define MAGIC_KEY_DEBUG_KBD K | ||
| 66 | #endif | ||
| 67 | |||
| 68 | #ifndef MAGIC_KEY_DEBUG_MOUSE | ||
| 69 | #define MAGIC_KEY_DEBUG_MOUSE M | ||
| 70 | #endif | ||
| 71 | |||
| 72 | #ifndef MAGIC_KEY_VERSION | ||
| 73 | #define MAGIC_KEY_VERSION V | ||
| 74 | #endif | ||
| 75 | |||
| 76 | #ifndef MAGIC_KEY_STATUS | ||
| 77 | #define MAGIC_KEY_STATUS S | ||
| 78 | #endif | ||
| 79 | |||
| 80 | #ifndef MAGIC_KEY_CONSOLE | ||
| 81 | #define MAGIC_KEY_CONSOLE C | ||
| 82 | #endif | ||
| 83 | |||
| 84 | #ifndef MAGIC_KEY_LAYER0_ALT1 | ||
| 85 | #define MAGIC_KEY_LAYER0_ALT1 ESC | ||
| 86 | #endif | ||
| 87 | |||
| 88 | #ifndef MAGIC_KEY_LAYER0_ALT2 | ||
| 89 | #define MAGIC_KEY_LAYER0_ALT2 GRAVE | ||
| 90 | #endif | ||
| 91 | |||
| 92 | #ifndef MAGIC_KEY_LAYER0 | ||
| 93 | #define MAGIC_KEY_LAYER0 0 | ||
| 94 | #endif | ||
| 95 | |||
| 96 | #ifndef MAGIC_KEY_LAYER1 | ||
| 97 | #define MAGIC_KEY_LAYER1 1 | ||
| 98 | #endif | ||
| 99 | |||
| 100 | #ifndef MAGIC_KEY_LAYER2 | ||
| 101 | #define MAGIC_KEY_LAYER2 2 | ||
| 102 | #endif | ||
| 103 | |||
| 104 | #ifndef MAGIC_KEY_LAYER3 | ||
| 105 | #define MAGIC_KEY_LAYER3 3 | ||
| 106 | #endif | ||
| 107 | |||
| 108 | #ifndef MAGIC_KEY_LAYER4 | ||
| 109 | #define MAGIC_KEY_LAYER4 4 | ||
| 110 | #endif | ||
| 111 | |||
| 112 | #ifndef MAGIC_KEY_LAYER5 | ||
| 113 | #define MAGIC_KEY_LAYER5 5 | ||
| 114 | #endif | ||
| 115 | |||
| 116 | #ifndef MAGIC_KEY_LAYER6 | ||
| 117 | #define MAGIC_KEY_LAYER6 6 | ||
| 118 | #endif | ||
| 119 | |||
| 120 | #ifndef MAGIC_KEY_LAYER7 | ||
| 121 | #define MAGIC_KEY_LAYER7 7 | ||
| 122 | #endif | ||
| 123 | |||
| 124 | #ifndef MAGIC_KEY_LAYER8 | ||
| 125 | #define MAGIC_KEY_LAYER8 8 | ||
| 35 | #endif | 126 | #endif |
| 127 | |||
| 128 | #ifndef MAGIC_KEY_LAYER9 | ||
| 129 | #define MAGIC_KEY_LAYER9 9 | ||
| 130 | #endif | ||
| 131 | |||
| 132 | #ifndef MAGIC_KEY_BOOTLOADER | ||
| 133 | #define MAGIC_KEY_BOOTLOADER PAUSE | ||
| 134 | #endif | ||
| 135 | |||
| 136 | #ifndef MAGIC_KEY_LOCK | ||
| 137 | #define MAGIC_KEY_LOCK CAPS | ||
| 138 | #endif | ||
| 139 | |||
| 140 | #ifndef MAGIC_KEY_EEPROM | ||
| 141 | #define MAGIC_KEY_EEPROM E | ||
| 142 | #endif | ||
| 143 | |||
| 144 | #ifndef MAGIC_KEY_NKRO | ||
| 145 | #define MAGIC_KEY_NKRO N | ||
| 146 | #endif | ||
| 147 | |||
| 148 | #ifndef MAGIC_KEY_SLEEP_LED | ||
| 149 | #define MAGIC_KEY_SLEEP_LED Z | ||
| 150 | |||
| 151 | #endif | ||
| 152 | |||
| 153 | #define XMAGIC_KC(key) KC_##key | ||
| 154 | #define MAGIC_KC(key) XMAGIC_KC(key) | ||
| 155 | |||
| 156 | #endif \ No newline at end of file | ||
diff --git a/tmk_core/common/keyboard.c b/tmk_core/common/keyboard.c index eb7b096be..e66808485 100644 --- a/tmk_core/common/keyboard.c +++ b/tmk_core/common/keyboard.c | |||
| @@ -70,6 +70,7 @@ void keyboard_setup(void) | |||
| 70 | 70 | ||
| 71 | void keyboard_init(void) | 71 | void keyboard_init(void) |
| 72 | { | 72 | { |
| 73 | |||
| 73 | timer_init(); | 74 | timer_init(); |
| 74 | matrix_init(); | 75 | matrix_init(); |
| 75 | #ifdef PS2_MOUSE_ENABLE | 76 | #ifdef PS2_MOUSE_ENABLE |
| @@ -90,6 +91,11 @@ void keyboard_init(void) | |||
| 90 | #ifdef BACKLIGHT_ENABLE | 91 | #ifdef BACKLIGHT_ENABLE |
| 91 | backlight_init(); | 92 | backlight_init(); |
| 92 | #endif | 93 | #endif |
| 94 | |||
| 95 | #ifdef FORCE_NKRO | ||
| 96 | keyboard_nkro = true; | ||
| 97 | #endif | ||
| 98 | |||
| 93 | } | 99 | } |
| 94 | 100 | ||
| 95 | /* | 101 | /* |
