]> git.donarmstrong.com Git - tmk_firmware.git/blobdiff - common/command.c
Clean host.h interface.
[tmk_firmware.git] / common / command.c
index 0020d8a17cc2c78d74d0726fb42b02d0aaab2f56..16c6cfb8896528009a26f9ec538323ea30ca5797 100644 (file)
@@ -17,7 +17,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include <stdint.h>
 #include <stdbool.h>
 #include <util/delay.h>
-#include "usb_keycodes.h"
+#include "keycode.h"
 #include "host.h"
 #include "print.h"
 #include "debug.h"
@@ -74,18 +74,16 @@ uint8_t command_extra(void)
 static uint8_t command_common(void)
 {
     switch (host_get_first_key()) {
-        case KB_H:
+        case KC_H:
             help();
             break;
-        case KB_B:
-            host_clear_keyboard_report();
-            host_send_keyboard_report();
+        case KC_B:
             print("jump to bootloader... ");
             _delay_ms(1000);
             bootloader_jump(); // not return
             print("not supported.\n");
             break;
-        case KB_D:
+        case KC_D:
             debug_enable = !debug_enable;
             if (debug_enable) {
                 last_print_enable = true;
@@ -101,34 +99,34 @@ static uint8_t command_common(void)
                 debug_mouse = false;
             }
             break;
-        case KB_X: // debug matrix toggle
+        case KC_X: // debug matrix toggle
             debug_matrix = !debug_matrix;
             if (debug_matrix)
                 print("debug matrix enabled.\n");
             else
                 print("debug matrix disabled.\n");
             break;
-        case KB_K: // debug keyboard toggle
+        case KC_K: // debug keyboard toggle
             debug_keyboard = !debug_keyboard;
             if (debug_keyboard)
                 print("debug keyboard enabled.\n");
             else
                 print("debug keyboard disabled.\n");
             break;
-        case KB_M: // debug mouse toggle
+        case KC_M: // debug mouse toggle
             debug_mouse = !debug_mouse;
             if (debug_mouse)
                 print("debug mouse enabled.\n");
             else
                 print("debug mouse disabled.\n");
             break;
-        case KB_V: // print version & information
+        case KC_V: // print version & information
             print(STR(DESCRIPTION) "\n");
             break;
-        case KB_T: // print timer
+        case KC_T: // print timer
             print("timer: "); phex16(timer_count); print("\n");
             break;
-        case KB_P: // print toggle
+        case KC_P: // print toggle
             if (last_print_enable) {
                 print("print disabled.\n");
                 last_print_enable = false;
@@ -137,7 +135,7 @@ static uint8_t command_common(void)
                 print("print enabled.\n");
             }
             break;
-        case KB_S:
+        case KC_S:
             print("host_keyboard_leds:"); phex(host_keyboard_leds()); print("\n");
 #ifdef HOST_PJRC
             print("UDCON: "); phex(UDCON); print("\n");
@@ -156,10 +154,7 @@ static uint8_t command_common(void)
 #endif
             break;
 #ifdef NKRO_ENABLE
-        case KB_N:
-            // send empty report before change
-            host_clear_keyboard_report();
-            host_send_keyboard_report();
+        case KC_N:
             keyboard_nkro = !keyboard_nkro;
             if (keyboard_nkro)
                 print("NKRO: enabled\n");
@@ -168,9 +163,7 @@ static uint8_t command_common(void)
             break;
 #endif
 #ifdef EXTRAKEY_ENABLE
-        case KB_ESC:
-            host_clear_keyboard_report();
-            host_send_keyboard_report();
+        case KC_ESC:
 #ifdef HOST_PJRC
             if (suspend && remote_wakeup) {
                 usb_remote_wakeup();
@@ -186,23 +179,23 @@ static uint8_t command_common(void)
 #endif
             break;
 #endif
-        case KB_BSPC:
+        case KC_BSPC:
             matrix_init();
             print("clear matrix\n");
             break;
-        case KB_0:
+        case KC_0:
             switch_layer(0);
             break;
-        case KB_1:
+        case KC_1:
             switch_layer(1);
             break;
-        case KB_2:
+        case KC_2:
             switch_layer(2);
             break;
-        case KB_3:
+        case KC_3:
             switch_layer(3);
             break;
-        case KB_4:
+        case KC_4:
             switch_layer(4);
             break;
         default: