X-Git-Url: https://git.friedersdorff.com/?a=blobdiff_plain;f=tmk_core%2Fprotocol%2Fibmpc.c;h=5f2ca79b2fba9f1bd8067b46ed1d2ca8ca6044a1;hb=43a46c8d280a93bbd4dc5a8c45e1a6bc68e0b38d;hp=a071db1986da8e93e827cb5bac7527a6e7f72812;hpb=343c32afc6d1dea955d14c17c8c1981c42418d8d;p=max%2Ftmk_keyboard.git diff --git a/tmk_core/protocol/ibmpc.c b/tmk_core/protocol/ibmpc.c index a071db19..5f2ca79b 100644 --- a/tmk_core/protocol/ibmpc.c +++ b/tmk_core/protocol/ibmpc.c @@ -253,8 +253,8 @@ ISR(IBMPC_INT_VECT) if (isr_state == 0x8000) { timer_start = t; } else { - // should not take more than 1ms - if (timer_start != t && (uint8_t)(timer_start + 1) != t) { + // This gives 2.0ms at least before timeout + if ((uint8_t)(t - timer_start) >= 3) { ibmpc_isr_debug = isr_state; ibmpc_error = IBMPC_ERR_TIMEOUT; goto ERROR; @@ -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: