ibmpc_usb: Fix led_set for XT keyobard

This commit is contained in:
tmk 2020-05-12 11:01:33 +09:00
parent 15434c3a16
commit fa58765325

View file

@ -295,6 +295,8 @@ uint8_t matrix_scan(void)
case PC_TERMINAL:
// Set all keys to make/break type
ibmpc_host_send(0xF8);
// This should not be harmful
led_set(host_keyboard_leds());
break;
default:
break;
@ -394,9 +396,19 @@ void matrix_clear(void)
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 != 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;
if (usb_led & (1<<USB_LED_SCROLL_LOCK))
ibmpc_led |= (1<<IBMPC_LED_SCROLL_LOCK);