|
|
|
@ -82,7 +82,8 @@ static const uint8_t BOOT_KEYBOARD_EP_SIZE = USB_EP_SIZE;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BootKeyboard_::BootKeyboard_(uint8_t protocol_) : PluggableUSBModule(1, 1, epType), default_protocol(protocol_), protocol(protocol_), idle(1), leds(0) {
|
|
|
|
|
BootKeyboard_::BootKeyboard_(uint8_t protocol_)
|
|
|
|
|
: PluggableUSBModule(1, 1, epType), default_protocol(protocol_), protocol(protocol_), idle(1), leds(0) {
|
|
|
|
|
#ifdef ARCH_HAS_CONFIGURABLE_EP_SIZES
|
|
|
|
|
epType[0] = EP_TYPE_INTERRUPT_IN(BOOT_KEYBOARD_EP_SIZE); // This is an 8 byte report, so ask for an 8 byte buffer, so reports aren't split
|
|
|
|
|
#else
|
|
|
|
@ -96,8 +97,7 @@ int BootKeyboard_::getInterface(uint8_t* interfaceCount) {
|
|
|
|
|
HIDDescriptor hidInterface = {
|
|
|
|
|
D_INTERFACE(pluggedInterface, 1, USB_DEVICE_CLASS_HUMAN_INTERFACE, HID_SUBCLASS_BOOT_INTERFACE, HID_PROTOCOL_KEYBOARD),
|
|
|
|
|
D_HIDREPORT(sizeof(boot_keyboard_hid_descriptor_)),
|
|
|
|
|
D_ENDPOINT(USB_ENDPOINT_IN(pluggedEndpoint), USB_ENDPOINT_TYPE_INTERRUPT, BOOT_KEYBOARD_EP_SIZE, 0x01)
|
|
|
|
|
};
|
|
|
|
|
D_ENDPOINT(USB_ENDPOINT_IN(pluggedEndpoint), USB_ENDPOINT_TYPE_INTERRUPT, BOOT_KEYBOARD_EP_SIZE, 0x01)};
|
|
|
|
|
return USB_SendControl(0, &hidInterface, sizeof(hidInterface));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -138,7 +138,6 @@ void BootKeyboard_::end() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool BootKeyboard_::setup(USBSetup &setup) {
|
|
|
|
|
if (pluggedInterface != setup.wIndex) {
|
|
|
|
|
return false;
|
|
|
|
@ -359,7 +358,6 @@ bool BootKeyboard_::wasKeyPressed(uint8_t k) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Returns true if the modifer key passed in will be sent during this key report
|
|
|
|
|
* Returns false in all other cases
|
|
|
|
|
* */
|
|
|
|
|