Skip to content

Commit 5e813b3

Browse files
committed
[PHID] Added some hints for further optional implementations
1 parent 14ddc8b commit 5e813b3

File tree

1 file changed

+9
-0
lines changed
  • hardware/arduino/avr/libraries/HID

1 file changed

+9
-0
lines changed

hardware/arduino/avr/libraries/HID/HID.cpp

+9
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ bool HID_::setup(USBSetup& setup)
101101
if (requestType == REQUEST_HOSTTODEVICE_CLASS_INTERFACE)
102102
{
103103
if (request == HID_SET_PROTOCOL) {
104+
// The USB Host tells us if we are in boot or report mode.
105+
// This only works with a real boot compatible device.
104106
protocol = setup.wValueL;
105107
return true;
106108
}
@@ -110,6 +112,13 @@ bool HID_::setup(USBSetup& setup)
110112
}
111113
if (request == HID_SET_REPORT)
112114
{
115+
//uint8_t reportID = setup.wValueL;
116+
//uint16_t length = setup.wLength;
117+
//uint8_t data[length];
118+
// Make sure to not read more data than USB_EP_SIZE.
119+
// You can read multiple times through a loop.
120+
// The first byte (may!) contain the reportID on a multreport.
121+
//USB_RecvControl(data, length);
113122
}
114123
}
115124

0 commit comments

Comments
 (0)