diff options
Diffstat (limited to 'common/command.c')
| -rw-r--r-- | common/command.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/common/command.c b/common/command.c index 0020d8a17..f9cdaf57d 100644 --- a/common/command.c +++ b/common/command.c | |||
| @@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 17 | #include <stdint.h> | 17 | #include <stdint.h> |
| 18 | #include <stdbool.h> | 18 | #include <stdbool.h> |
| 19 | #include <util/delay.h> | 19 | #include <util/delay.h> |
| 20 | #include "usb_keycodes.h" | 20 | #include "keycode.h" |
| 21 | #include "host.h" | 21 | #include "host.h" |
| 22 | #include "print.h" | 22 | #include "print.h" |
| 23 | #include "debug.h" | 23 | #include "debug.h" |
| @@ -74,10 +74,10 @@ uint8_t command_extra(void) | |||
| 74 | static uint8_t command_common(void) | 74 | static uint8_t command_common(void) |
| 75 | { | 75 | { |
| 76 | switch (host_get_first_key()) { | 76 | switch (host_get_first_key()) { |
| 77 | case KB_H: | 77 | case KC_H: |
| 78 | help(); | 78 | help(); |
| 79 | break; | 79 | break; |
| 80 | case KB_B: | 80 | case KC_B: |
| 81 | host_clear_keyboard_report(); | 81 | host_clear_keyboard_report(); |
| 82 | host_send_keyboard_report(); | 82 | host_send_keyboard_report(); |
| 83 | print("jump to bootloader... "); | 83 | print("jump to bootloader... "); |
| @@ -85,7 +85,7 @@ static uint8_t command_common(void) | |||
| 85 | bootloader_jump(); // not return | 85 | bootloader_jump(); // not return |
| 86 | print("not supported.\n"); | 86 | print("not supported.\n"); |
| 87 | break; | 87 | break; |
| 88 | case KB_D: | 88 | case KC_D: |
| 89 | debug_enable = !debug_enable; | 89 | debug_enable = !debug_enable; |
| 90 | if (debug_enable) { | 90 | if (debug_enable) { |
| 91 | last_print_enable = true; | 91 | last_print_enable = true; |
| @@ -101,34 +101,34 @@ static uint8_t command_common(void) | |||
| 101 | debug_mouse = false; | 101 | debug_mouse = false; |
| 102 | } | 102 | } |
| 103 | break; | 103 | break; |
| 104 | case KB_X: // debug matrix toggle | 104 | case KC_X: // debug matrix toggle |
| 105 | debug_matrix = !debug_matrix; | 105 | debug_matrix = !debug_matrix; |
| 106 | if (debug_matrix) | 106 | if (debug_matrix) |
| 107 | print("debug matrix enabled.\n"); | 107 | print("debug matrix enabled.\n"); |
| 108 | else | 108 | else |
| 109 | print("debug matrix disabled.\n"); | 109 | print("debug matrix disabled.\n"); |
| 110 | break; | 110 | break; |
| 111 | case KB_K: // debug keyboard toggle | 111 | case KC_K: // debug keyboard toggle |
| 112 | debug_keyboard = !debug_keyboard; | 112 | debug_keyboard = !debug_keyboard; |
| 113 | if (debug_keyboard) | 113 | if (debug_keyboard) |
| 114 | print("debug keyboard enabled.\n"); | 114 | print("debug keyboard enabled.\n"); |
| 115 | else | 115 | else |
| 116 | print("debug keyboard disabled.\n"); | 116 | print("debug keyboard disabled.\n"); |
| 117 | break; | 117 | break; |
| 118 | case KB_M: // debug mouse toggle | 118 | case KC_M: // debug mouse toggle |
| 119 | debug_mouse = !debug_mouse; | 119 | debug_mouse = !debug_mouse; |
| 120 | if (debug_mouse) | 120 | if (debug_mouse) |
| 121 | print("debug mouse enabled.\n"); | 121 | print("debug mouse enabled.\n"); |
| 122 | else | 122 | else |
| 123 | print("debug mouse disabled.\n"); | 123 | print("debug mouse disabled.\n"); |
| 124 | break; | 124 | break; |
| 125 | case KB_V: // print version & information | 125 | case KC_V: // print version & information |
| 126 | print(STR(DESCRIPTION) "\n"); | 126 | print(STR(DESCRIPTION) "\n"); |
| 127 | break; | 127 | break; |
| 128 | case KB_T: // print timer | 128 | case KC_T: // print timer |
| 129 | print("timer: "); phex16(timer_count); print("\n"); | 129 | print("timer: "); phex16(timer_count); print("\n"); |
| 130 | break; | 130 | break; |
| 131 | case KB_P: // print toggle | 131 | case KC_P: // print toggle |
| 132 | if (last_print_enable) { | 132 | if (last_print_enable) { |
| 133 | print("print disabled.\n"); | 133 | print("print disabled.\n"); |
| 134 | last_print_enable = false; | 134 | last_print_enable = false; |
| @@ -137,7 +137,7 @@ static uint8_t command_common(void) | |||
| 137 | print("print enabled.\n"); | 137 | print("print enabled.\n"); |
| 138 | } | 138 | } |
| 139 | break; | 139 | break; |
| 140 | case KB_S: | 140 | case KC_S: |
| 141 | print("host_keyboard_leds:"); phex(host_keyboard_leds()); print("\n"); | 141 | print("host_keyboard_leds:"); phex(host_keyboard_leds()); print("\n"); |
| 142 | #ifdef HOST_PJRC | 142 | #ifdef HOST_PJRC |
| 143 | print("UDCON: "); phex(UDCON); print("\n"); | 143 | print("UDCON: "); phex(UDCON); print("\n"); |
| @@ -156,7 +156,7 @@ static uint8_t command_common(void) | |||
| 156 | #endif | 156 | #endif |
| 157 | break; | 157 | break; |
| 158 | #ifdef NKRO_ENABLE | 158 | #ifdef NKRO_ENABLE |
| 159 | case KB_N: | 159 | case KC_N: |
| 160 | // send empty report before change | 160 | // send empty report before change |
| 161 | host_clear_keyboard_report(); | 161 | host_clear_keyboard_report(); |
| 162 | host_send_keyboard_report(); | 162 | host_send_keyboard_report(); |
| @@ -168,7 +168,7 @@ static uint8_t command_common(void) | |||
| 168 | break; | 168 | break; |
| 169 | #endif | 169 | #endif |
| 170 | #ifdef EXTRAKEY_ENABLE | 170 | #ifdef EXTRAKEY_ENABLE |
| 171 | case KB_ESC: | 171 | case KC_ESC: |
| 172 | host_clear_keyboard_report(); | 172 | host_clear_keyboard_report(); |
| 173 | host_send_keyboard_report(); | 173 | host_send_keyboard_report(); |
| 174 | #ifdef HOST_PJRC | 174 | #ifdef HOST_PJRC |
| @@ -186,23 +186,23 @@ static uint8_t command_common(void) | |||
| 186 | #endif | 186 | #endif |
| 187 | break; | 187 | break; |
| 188 | #endif | 188 | #endif |
| 189 | case KB_BSPC: | 189 | case KC_BSPC: |
| 190 | matrix_init(); | 190 | matrix_init(); |
| 191 | print("clear matrix\n"); | 191 | print("clear matrix\n"); |
| 192 | break; | 192 | break; |
| 193 | case KB_0: | 193 | case KC_0: |
| 194 | switch_layer(0); | 194 | switch_layer(0); |
| 195 | break; | 195 | break; |
| 196 | case KB_1: | 196 | case KC_1: |
| 197 | switch_layer(1); | 197 | switch_layer(1); |
| 198 | break; | 198 | break; |
| 199 | case KB_2: | 199 | case KC_2: |
| 200 | switch_layer(2); | 200 | switch_layer(2); |
| 201 | break; | 201 | break; |
| 202 | case KB_3: | 202 | case KC_3: |
| 203 | switch_layer(3); | 203 | switch_layer(3); |
| 204 | break; | 204 | break; |
| 205 | case KB_4: | 205 | case KC_4: |
| 206 | switch_layer(4); | 206 | switch_layer(4); |
| 207 | break; | 207 | break; |
| 208 | default: | 208 | default: |
