X-Git-Url: https://git.friedersdorff.com/?a=blobdiff_plain;ds=sidebyside;f=tmk_core%2Fprotocol%2Fibmpc.c;h=0e94e301214c35078e7a26db2f3603d31d9feecc;hb=7544754df42ebc01d9c86f40571d282a9b5878f4;hp=e84548c626c460d9c072c82c06dae240b7ae11dc;hpb=574fc5e2e835cf365c1a8c691db35a4025940ada;p=max%2Ftmk_keyboard.git diff --git a/tmk_core/protocol/ibmpc.c b/tmk_core/protocol/ibmpc.c index e84548c6..0e94e301 100644 --- a/tmk_core/protocol/ibmpc.c +++ b/tmk_core/protocol/ibmpc.c @@ -136,6 +136,7 @@ int16_t ibmpc_host_send(uint8_t data) wait_us(15); data_hi(); WAIT(clock_hi, 50, 6); + if (ibmpc_protocol == IBMPC_PROTOCOL_AT_Z150) { goto RECV; } WAIT(clock_lo, 50, 7); /* Ack */ @@ -145,6 +146,7 @@ int16_t ibmpc_host_send(uint8_t data) WAIT(clock_hi, 50, 9); WAIT(data_hi, 50, 10); +RECV: // clear buffer to get response correctly recv_data = 0xFFFF; ibmpc_host_isr_clear(); @@ -253,8 +255,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;