Skip to content

Commit

Permalink
ibmpc_usb: test for
Browse files Browse the repository at this point in the history
1) wait for command response of read ID 'F2'
2) control lock indicators at startup
  • Loading branch information
tmk committed Feb 12, 2021
1 parent 2873d4f commit 3163a11
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
7 changes: 2 additions & 5 deletions converter/ibmpc_usb/ibmpc_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@ static uint16_t read_keyboard_id(void)
uint16_t id = 0;
int16_t code = 0;

// temporary fix Z-150 AT should response with ID
if (ibmpc_protocol == IBMPC_PROTOCOL_AT_Z150) return 0xFFFD;

// Disable
//code = ibmpc_host_send(0xF5);

Expand Down Expand Up @@ -279,6 +276,8 @@ uint8_t matrix_scan(void)
break;
case READ_ID:
keyboard_id = read_keyboard_id();
// for test
if (ibmpc_protocol == IBMPC_PROTOCOL_AT_Z150) keyboard_id = 0xFFFD;
xprintf("R%u ", timer_read());

if (0x0000 == keyboard_id) { // CodeSet2 AT(IBM PC AT 84-key)
Expand Down Expand Up @@ -329,8 +328,6 @@ uint8_t matrix_scan(void)
case PC_XT:
break;
case PC_AT:
// TODO: led_set() works for Zenith Z-150 AT?
if (ibmpc_protocol == IBMPC_PROTOCOL_AT_Z150) break;
led_set(host_keyboard_leds());
break;
case PC_TERMINAL:
Expand Down
2 changes: 1 addition & 1 deletion tmk_core/protocol/ibmpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ int16_t ibmpc_host_recv(void)
int16_t ibmpc_host_recv_response(void)
{
// Command may take 25ms/20ms at most([5]p.46, [3]p.21)
uint8_t retry = 25;
uint8_t retry = 250;
int16_t data = -1;
while (retry-- && (data = ibmpc_host_recv()) == -1) {
wait_ms(1);
Expand Down

0 comments on commit 3163a11

Please sign in to comment.