]> git.friedersdorff.com Git - max/tmk_keyboard.git/commitdiff
ibmpc_usb: Add info to debug print
authortmk <hasu@tmk-kbd.com>
Mon, 16 Nov 2020 02:32:53 +0000 (11:32 +0900)
committertmk <hasu@tmk-kbd.com>
Sun, 22 Nov 2020 12:27:45 +0000 (21:27 +0900)
converter/ibmpc_usb/ibmpc_usb.c
converter/ibmpc_usb/ibmpc_usb.h

index 9347793f877dc8a0313c8bafb97f6437dc17b452..6d22ad736d660f8d52924c249678161c597af458 100644 (file)
@@ -174,6 +174,7 @@ uint8_t matrix_scan(void)
             xprintf("I%u ", timer_read());
             keyboard_kind = NONE;
             keyboard_id = 0x0000;
+            current_protocol = 0;
 
             matrix_clear();
             clear_keyboard();
@@ -311,7 +312,7 @@ uint8_t matrix_scan(void)
                 keyboard_kind = PC_AT;
             }
 
-            xprintf("\nID:%04X(%d) ", keyboard_id, keyboard_kind);
+            xprintf("\nID:%04X(%s) ", keyboard_id, KEYBOARD_KIND_STR(keyboard_kind));
 
             state = SETUP;
             break;
index 86ebe17d68339289424d55af7175334cc4a3fbcb..e08be6e4b1028d2cecb34457b7aa808110072868 100644 (file)
@@ -2,6 +2,13 @@
 #define IBMPC_USB_H
 
 typedef enum { NONE, PC_XT, PC_AT, PC_TERMINAL, PC_AT_Z150 } keyboard_kind_t;
+#define KEYBOARD_KIND_STR(kind) \
+    (kind == PC_XT ? "XT" :   \
+     kind == PC_AT ? "AT" :   \
+     kind == PC_TERMINAL ? "TERMINAL" :   \
+     kind == PC_AT_Z150 ? "AT_Z150" :  \
+     "NONE")
+
 
 extern uint16_t keyboard_id;
 extern keyboard_kind_t keyboard_kind;