]> git.friedersdorff.com Git - max/tmk_keyboard.git/commitdiff
ibmpc_usb: Fix Disable/Enable keyboard
authortmk <hasu@tmk-kbd.com>
Fri, 17 Jan 2020 04:41:14 +0000 (13:41 +0900)
committertmk <hasu@tmk-kbd.com>
Sat, 29 Feb 2020 08:29:54 +0000 (17:29 +0900)
- Return without enabling with F4 for 84-key AT wrongly before this fix
- disable/enable doesn't seems to be needed

converter/ibmpc_usb/ibmpc_usb.c

index 0527cfcf510c59e4b990951344e53db6de5736b2..ae897bb05f579bcf31b298f9720097b86e6f5a8d 100644 (file)
@@ -55,22 +55,23 @@ static uint16_t read_keyboard_id(void)
     int16_t  code = 0;
 
     // Disable
-    code = ibmpc_host_send(0xF5);
+    //code = ibmpc_host_send(0xF5);
 
     // Read ID
     code = ibmpc_host_send(0xF2);
-    if (code == -1)  return 0xFFFF;     // XT or No keyboard
-    if (code != 0xFA) return 0xFFFE;    // Broken PS/2?
+    if (code == -1) { id = 0xFFFF; goto DONE; }     // XT or No keyboard
+    if (code != 0xFA) { id = 0xFFFE; goto DONE; }   // Broken PS/2?
 
     code = read_wait(1000);
-    if (code == -1)  return 0x0000;     // AT
+    if (code == -1) { id = 0x0000; goto DONE; }     // AT
     id = (code & 0xFF)<<8;
 
     code = read_wait(1000);
     id |= code & 0xFF;
 
+DONE:
     // Enable
-    code = ibmpc_host_send(0xF4);
+    //code = ibmpc_host_send(0xF4);
 
     return id;
 }