ibmpc_usb: Fix Disable/Enable keyboard
- Return without enabling with F4 for 84-key AT wrongly before this fix - disable/enable doesn't seems to be needed
This commit is contained in:
parent
7587fe3382
commit
cb026d74a5
1 changed files with 6 additions and 5 deletions
|
|
@ -55,22 +55,23 @@ static uint16_t read_keyboard_id(void)
|
|||
int16_t code = 0;
|
||||
|
||||
// Disable
|
||||
code = ibmpc_host_send(0xF5);
|
||||
//code = ibmpc_host_send(0xF5);
|
||||
|
||||
// Read ID
|
||||
code = ibmpc_host_send(0xF2);
|
||||
if (code == -1) return 0xFFFF; // XT or No keyboard
|
||||
if (code != 0xFA) return 0xFFFE; // Broken PS/2?
|
||||
if (code == -1) { id = 0xFFFF; goto DONE; } // XT or No keyboard
|
||||
if (code != 0xFA) { id = 0xFFFE; goto DONE; } // Broken PS/2?
|
||||
|
||||
code = read_wait(1000);
|
||||
if (code == -1) return 0x0000; // AT
|
||||
if (code == -1) { id = 0x0000; goto DONE; } // AT
|
||||
id = (code & 0xFF)<<8;
|
||||
|
||||
code = read_wait(1000);
|
||||
id |= code & 0xFF;
|
||||
|
||||
DONE:
|
||||
// Enable
|
||||
code = ibmpc_host_send(0xF4);
|
||||
//code = ibmpc_host_send(0xF4);
|
||||
|
||||
return id;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue