keyboardio / KeyboardioHID

A HID library for Arduino
MIT License
34 stars 17 forks source link

reset protocol on bus reset #93

Closed tlyu closed 1 year ago

tlyu commented 1 year ago

Only reset boot/report protocol on USB bus reset. Windows 10 will sometimes try to cache report descriptors if it has high confidence that it's a device it's seen before. This means it won't retrieve either the configuration descriptor set or the report descriptors when resetting after receving control from the BIOS/UEFI. The BIOS or UEFI probably set the boot keyboard to boot protocol, which meant that when Windows regained control, the boot keyboard was still in boot protocol, contrary to the USB HID specification.

This requires the higher-level driver to call a polling function, because detection of USB reset events isn't as portable as checking the USB device configuration.

tlyu commented 1 year ago

Note that on GD32, this requires keyboardio/ArduinoCore-GD32-Keyboardio#20.