]> git.friedersdorff.com Git - max/tmk_keyboard.git/commitdiff
ibmpc: Add Z-150 AT protocol recognition
authortmk <hasu@tmk-kbd.com>
Wed, 13 May 2020 14:34:42 +0000 (23:34 +0900)
committertmk <hasu@tmk-kbd.com>
Fri, 15 May 2020 05:32:14 +0000 (14:32 +0900)
https://github.com/tmk/tmk_keyboard/wiki/IBM-PC-AT-Keyboard-Protocol#zenith-z-150-beige

tmk_core/protocol/ibmpc.c
tmk_core/protocol/ibmpc.h

index a071db1986da8e93e827cb5bac7527a6e7f72812..e84548c626c460d9c072c82c06dae240b7ae11dc 100644 (file)
@@ -359,12 +359,17 @@ ISR(IBMPC_INT_VECT)
         case 0b01010000:
         case 0b11010000:
             // AT-done
-            // DO NOT check stop bit. Zenith Z-150(AT) asserts stop bit as low for no reason.
-            // https://github.com/tmk/tmk_keyboard/wiki/IBM-PC-AT-Keyboard-Protocol#zenith-z-150-beige
             // TODO: parity check?
             ibmpc_isr_debug = isr_state;
+            // stop bit check
+            if (isr_state & 0x8000) {
+                ibmpc_protocol = IBMPC_PROTOCOL_AT;
+            } else {
+                // Zenith Z-150 AT(beige/white lable) asserts stop bit as low
+                // https://github.com/tmk/tmk_keyboard/wiki/IBM-PC-AT-Keyboard-Protocol#zenith-z-150-beige
+                ibmpc_protocol = IBMPC_PROTOCOL_AT_Z150;
+            }
             isr_state = isr_state>>6;
-            ibmpc_protocol = IBMPC_PROTOCOL_AT;
             goto DONE;
             break;
         case 0b01100000:
index c994ddb63b6321e7f7628423eeba90f3a65a6c17..4f682aa7214fddbb08e72a82790946b031f2c4b2 100644 (file)
@@ -72,6 +72,7 @@ POSSIBILITY OF SUCH DAMAGE.
 
 #define IBMPC_PROTOCOL_NO       0
 #define IBMPC_PROTOCOL_AT       0x10
+#define IBMPC_PROTOCOL_AT_Z150  0x11
 #define IBMPC_PROTOCOL_XT       0x20
 #define IBMPC_PROTOCOL_XT_IBM   0x21
 #define IBMPC_PROTOCOL_XT_CLONE 0x22