From 8e34275c746c1f4567543883ad6e2e3d8a9b1b92 Mon Sep 17 00:00:00 2001 From: tmk Date: Fri, 5 Feb 2021 21:50:57 +0900 Subject: [PATCH] ibmpc: Fix start bit error for Zenith Z-150 AT #661 ibmpc_host_send() can miss 1st clock from Zenith Z-150 AT sometimes. https://github.com/tmk/tmk_keyboard/issues/661#issuecomment-772298392 --- tmk_core/protocol/ibmpc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tmk_core/protocol/ibmpc.c b/tmk_core/protocol/ibmpc.c index 0f093f800a..9d5791e914 100644 --- a/tmk_core/protocol/ibmpc.c +++ b/tmk_core/protocol/ibmpc.c @@ -111,7 +111,7 @@ int16_t ibmpc_host_send(uint8_t data) data_lo(); wait_us(100); clock_hi(); // [5]p.54 [clock low]>100us [5]p.50 - WAIT(clock_lo, 10000, 1); // [5]p.53, -10ms [5]p.50 + WAIT(clock_lo, 60000, 1); // [5]p.53, -10ms [5]p.50 /* Data bit[2-9] */ for (uint8_t i = 0; i < 8; i++) { @@ -162,6 +162,8 @@ int16_t ibmpc_host_send(uint8_t data) // https://github.com/tmk/tmk_keyboard/wiki/IBM-PC-AT-Keyboard-Protocol#zenith-z-150-beige if (!ibmpc_protocol && ibmpc_error == 7) { goto RECV; } + inhibit(); + wait_ms(2); idle(); IBMPC_INT_ON(); return -1;