Skip to content

Commit ee2a83e

Browse files
authored
Update HID.cpp
1 parent 6154b7a commit ee2a83e

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

libraries/HID/src/HID.cpp

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,13 +133,21 @@ bool HID_::setup(USBSetup& setup)
133133
}
134134
if (request == HID_SET_REPORT)
135135
{
136-
//uint8_t reportID = setup.wValueL;
137-
//uint16_t length = setup.wLength;
138-
//uint8_t data[length];
136+
uint8_t reportID = setup.wValueL;
137+
uint16_t length = setup.wLength;
138+
uint8_t data[length];
139139
// Make sure to not read more data than USB_EP_SIZE.
140140
// You can read multiple times through a loop.
141141
// The first byte (may!) contain the reportID on a multreport.
142142
//USB_RecvControl(data, length);
143+
if ((reportID == 2) && (length == 2))
144+
{
145+
if (2 == USB_RecvControl(data, length))
146+
{
147+
_keyboardLedsStatus = data[1];
148+
return true;
149+
}
150+
}
143151
}
144152
}
145153

0 commit comments

Comments
 (0)