ibmpc_usb: Fix led_set for XT keyobard
This commit is contained in:
parent
15434c3a16
commit
fa58765325
1 changed files with 13 additions and 1 deletions
|
|
@ -295,6 +295,8 @@ uint8_t matrix_scan(void)
|
||||||
case PC_TERMINAL:
|
case PC_TERMINAL:
|
||||||
// Set all keys to make/break type
|
// Set all keys to make/break type
|
||||||
ibmpc_host_send(0xF8);
|
ibmpc_host_send(0xF8);
|
||||||
|
// This should not be harmful
|
||||||
|
led_set(host_keyboard_leds());
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
@ -394,9 +396,19 @@ void matrix_clear(void)
|
||||||
|
|
||||||
void led_set(uint8_t usb_led)
|
void led_set(uint8_t usb_led)
|
||||||
{
|
{
|
||||||
|
// Sending before keyboard recognition may be harmful for XT keyboard
|
||||||
if (keyboard_kind == NONE) return;
|
if (keyboard_kind == NONE) return;
|
||||||
//if (keyboard_kind != PC_AT) return;
|
|
||||||
|
|
||||||
|
// XT keyobard doesn't support any command and it is harmful perhaps
|
||||||
|
// https://github.com/tmk/tmk_keyboard/issues/635#issuecomment-626993437
|
||||||
|
if (keyboard_kind == PC_XT) return;
|
||||||
|
|
||||||
|
// It should be safe to send the command to keyboards with AT protocol
|
||||||
|
// - IBM Terminal doesn't support the command and response with 0xFE but it is not harmful.
|
||||||
|
// - Some other Terminals like G80-2551 supports the command.
|
||||||
|
// https://geekhack.org/index.php?topic=103648.msg2894921#msg2894921
|
||||||
|
|
||||||
|
// TODO: PC_TERMINAL_IBM_RT support
|
||||||
uint8_t ibmpc_led = 0;
|
uint8_t ibmpc_led = 0;
|
||||||
if (usb_led & (1<<USB_LED_SCROLL_LOCK))
|
if (usb_led & (1<<USB_LED_SCROLL_LOCK))
|
||||||
ibmpc_led |= (1<<IBMPC_LED_SCROLL_LOCK);
|
ibmpc_led |= (1<<IBMPC_LED_SCROLL_LOCK);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue