Skip to content

Commit

Permalink
Remove retries in kbc_aux_send. kbc_aux_read/kbc_data_read already in…
Browse files Browse the repository at this point in the history
…clude enough retries

Signed-off-by: Sergey Kiselev <[email protected]>
  • Loading branch information
skiselev committed Feb 6, 2024
1 parent a03b60b commit 8fd8cea
Show file tree
Hide file tree
Showing 6 changed files with 75 additions and 85 deletions.
47 changes: 23 additions & 24 deletions binaries/bios-sergey-xt-noide.rom

Large diffs are not rendered by default.

47 changes: 23 additions & 24 deletions binaries/bios-sergey-xt-xtide.rom

Large diffs are not rendered by default.

47 changes: 23 additions & 24 deletions binaries/bios-xi8088-noide.rom

Large diffs are not rendered by default.

Binary file modified binaries/bios-xi8088-xtide.rom
Binary file not shown.
Binary file modified binaries/bios-xi8088.bin
Binary file not shown.
19 changes: 6 additions & 13 deletions src/at_kbc.inc
Original file line number Diff line number Diff line change
Expand Up @@ -272,22 +272,15 @@ kbc_aux_send:
mov al,kbc_cmd_aux_snd ; write byte to auxiliary device
call kbc_send_cmd
jc .timeout ; kbc_send_cmd timed out

; wait for acknowledge
mov cx,10 ; retry 10 times
.retry:
call kbc_aux_read
jnc .check_reply ; CF==0 - data is available
loop .retry
jmp .timeout ; no reply - timeout
.check_reply:
call kbc_aux_read ; read acknowledge from device
jc .timeout ; no reply - timeout
cmp al,dev_rsp_ack
je .ok
cmp al,dev_rsp_resend
je .resend
cmp al,dev_rsp_error
je .timeout ; treat as timeout/interface error
loop .retry
; Optimization: any other responses result in timeout/interface error
; cmp al,dev_rsp_error
; je .timeout ; treat as timeout/interface error
jmp .timeout

.ok:
Expand Down Expand Up @@ -506,7 +499,7 @@ kbc_init:
je .keyboard_bat_ok ; all good, do not reset the keyboard

.keyboard_reset:
mov dh,e_kbd_bat_fail ; major error numbre
mov dh,e_kbd_bat_fail ; major error number
mov dl,e_kbd_tout_fail ; minor error number
mov al,dev_cmd_reset
call kbc_write_data ; send reset command to the keyboard
Expand Down

0 comments on commit 8fd8cea

Please sign in to comment.