adb: Fix for set LED
ADB Manager documents p.5-28 > Register 2 contains sixteen bits; be sure to change only the three bits > that represent the three LED lights. https://developer.apple.com/library/archive/documentation/mac/pdf/Devices/ADB_Manager.pdf iMate reads register2 before setting LED state for this. https://github.com/tmk/tmk_keyboard/wiki/Apple-Desktop-Bus#set-led
This commit is contained in:
parent
0b3ee443ec
commit
083a008b66
1 changed files with 3 additions and 1 deletions
|
|
@ -285,7 +285,9 @@ void adb_host_kbd_led(uint8_t addr, uint8_t led)
|
||||||
// Listen Register2
|
// Listen Register2
|
||||||
// upper byte: not used
|
// upper byte: not used
|
||||||
// lower byte: bit2=ScrollLock, bit1=CapsLock, bit0=NumLock
|
// lower byte: bit2=ScrollLock, bit1=CapsLock, bit0=NumLock
|
||||||
adb_host_listen(addr, 2, 0, led & 0x07);
|
uint16_t reg2 = adb_host_talk(addr, 2);
|
||||||
|
_delay_us(400);
|
||||||
|
adb_host_listen(addr, 2, reg2 >> 8, (reg2 & 0xF8) | (led & 0x07));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue