Skip to content

Commit

Permalink
ibmpc: Fix Stop bit error for Zenith Z-150 AT #661
Browse files Browse the repository at this point in the history
  • Loading branch information
tmk committed Feb 6, 2021
1 parent 141253e commit a4bdf5e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tmk_core/protocol/ibmpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ int16_t ibmpc_host_send(uint8_t data)
wait_us(15);
data_hi();
WAIT(clock_hi, 50, 6);
// Zenith Z-150 AT doesn't have 11th clock for ACK.
if (ibmpc_protocol == IBMPC_PROTOCOL_AT_Z150) { goto RECV; }
WAIT(clock_lo, 50, 7);

Expand All @@ -156,6 +157,11 @@ int16_t ibmpc_host_send(uint8_t data)
return ibmpc_host_recv_response();
ERROR:
ibmpc_error |= IBMPC_ERR_SEND;

// This error can happen before protocol recognition of Zenith Z-150 AT.
// https://github.com/tmk/tmk_keyboard/wiki/IBM-PC-AT-Keyboard-Protocol#zenith-z-150-beige
if (!ibmpc_protocol && ibmpc_error == 7) { goto RECV; }

idle();
IBMPC_INT_ON();
return -1;
Expand Down

0 comments on commit a4bdf5e

Please sign in to comment.