Fixed Keyboard Leds
This commit is contained in:
parent
d6c44e4698
commit
5dd1e991fd
1 changed files with 8 additions and 7 deletions
|
|
@ -55,12 +55,9 @@ int BootKeyboard_::getDescriptor(USBSetup& setup)
|
||||||
|
|
||||||
bool BootKeyboard_::setup(USBSetup& setup)
|
bool BootKeyboard_::setup(USBSetup& setup)
|
||||||
{
|
{
|
||||||
// Check if this is a HID Class Descriptor request
|
if (pluggedInterface != setup.wIndex) {
|
||||||
if (setup.bmRequestType != REQUEST_DEVICETOHOST_STANDARD_INTERFACE) { return false; }
|
return false;
|
||||||
if (setup.wValueH != HID_REPORT_DESCRIPTOR_TYPE) { return false; }
|
}
|
||||||
|
|
||||||
// In a HID Class Descriptor wIndex cointains the interface number
|
|
||||||
if (setup.wIndex != pluggedInterface) { return false; }
|
|
||||||
|
|
||||||
uint8_t request = setup.bRequest;
|
uint8_t request = setup.bRequest;
|
||||||
uint8_t requestType = setup.bmRequestType;
|
uint8_t requestType = setup.bmRequestType;
|
||||||
|
|
@ -89,7 +86,11 @@ bool BootKeyboard_::setup(USBSetup& setup)
|
||||||
}
|
}
|
||||||
if (request == HID_SET_REPORT)
|
if (request == HID_SET_REPORT)
|
||||||
{
|
{
|
||||||
//TODO
|
// Check if data has the correct length
|
||||||
|
auto length = setup.wLength;
|
||||||
|
if(length == sizeof(leds)){
|
||||||
|
USB_RecvControl(&leds, length);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue