]> git.friedersdorff.com Git - max/tmk_keyboard.git/commitdiff
ibmpc_usb: Add Z-150 AT support
authortmk <hasu@tmk-kbd.com>
Mon, 16 Nov 2020 02:32:08 +0000 (11:32 +0900)
committertmk <hasu@tmk-kbd.com>
Sun, 22 Nov 2020 12:12:37 +0000 (21:12 +0900)
converter/ibmpc_usb/ibmpc_usb.c
converter/ibmpc_usb/ibmpc_usb.h

index f31e83dd4457c6778d9767440272a05e803369f3..9347793f877dc8a0313c8bafb97f6437dc17b452 100644 (file)
@@ -55,6 +55,9 @@ static uint16_t read_keyboard_id(void)
     uint16_t id = 0;
     int16_t  code = 0;
 
+    // temporary fix Z-150 AT should response with ID
+    if (ibmpc_protocol == IBMPC_PROTOCOL_AT_Z150) return 0xFFFD;
+
     // Disable
     //code = ibmpc_host_send(0xF5);
 
@@ -276,6 +279,8 @@ uint8_t matrix_scan(void)
                 keyboard_kind = PC_XT;
             } else if (0xFFFE == keyboard_id) {     // CodeSet2 PS/2 fails to response?
                 keyboard_kind = PC_AT;
+            } else if (0xFFFD == keyboard_id) {     // Zenith Z-150 AT
+                keyboard_kind = PC_AT_Z150;
             } else if (0x00FF == keyboard_id) {     // Mouse is not supported
                 xprintf("Mouse: not supported\n");
                 keyboard_kind = NONE;
@@ -318,6 +323,9 @@ uint8_t matrix_scan(void)
                 case PC_AT:
                     led_set(host_keyboard_leds());
                     break;
+                case PC_AT_Z150:
+                    // TODO: do not set indicators temporarily for debug
+                    break;
                 case PC_TERMINAL:
                     // Set all keys to make/break type
                     ibmpc_host_send(0xF8);
@@ -355,6 +363,7 @@ uint8_t matrix_scan(void)
                         if (process_cs1(code) == -1) state = INIT;
                         break;
                     case PC_AT:
+                    case PC_AT_Z150:
                         if (process_cs2(code) == -1) state = INIT;
                         break;
                     case PC_TERMINAL:
index 99bce7e4953771eb6ce37b104ec7f35126882d0b..86ebe17d68339289424d55af7175334cc4a3fbcb 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef IBMPC_USB_H
 #define IBMPC_USB_H
 
-typedef enum { NONE, PC_XT, PC_AT, PC_TERMINAL } keyboard_kind_t;
+typedef enum { NONE, PC_XT, PC_AT, PC_TERMINAL, PC_AT_Z150 } keyboard_kind_t;
 
 extern uint16_t keyboard_id;
 extern keyboard_kind_t keyboard_kind;