Skip to content

Commit 720629d

Browse files
committed
Added a comment to HID.h directing people who want deeper functionality to user-contributed libraries and removed TODO's that will not be pursued in this library.
Fixes: #6390
1 parent cd798ab commit 720629d

File tree

2 files changed

+10
-19
lines changed

2 files changed

+10
-19
lines changed

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

+1-19
Original file line numberDiff line numberDiff line change
@@ -106,17 +106,9 @@ bool HID_::setup(USBSetup& setup)
106106

107107
if (requestType == REQUEST_DEVICETOHOST_CLASS_INTERFACE)
108108
{
109-
if (request == HID_GET_REPORT) {
110-
// TODO: HID_GetReport();
109+
if (request == HID_GET_REPORT || request == HID_GET_PROTOCOL)
111110
return true;
112111
}
113-
if (request == HID_GET_PROTOCOL) {
114-
// TODO: Send8(protocol);
115-
return true;
116-
}
117-
if (request == HID_GET_IDLE) {
118-
// TODO: Send8(idle);
119-
}
120112
}
121113

122114
if (requestType == REQUEST_HOSTTODEVICE_CLASS_INTERFACE)
@@ -131,16 +123,6 @@ bool HID_::setup(USBSetup& setup)
131123
idle = setup.wValueL;
132124
return true;
133125
}
134-
if (request == HID_SET_REPORT)
135-
{
136-
//uint8_t reportID = setup.wValueL;
137-
//uint16_t length = setup.wLength;
138-
//uint8_t data[length];
139-
// Make sure to not read more data than USB_EP_SIZE.
140-
// You can read multiple times through a loop.
141-
// The first byte (may!) contain the reportID on a multreport.
142-
//USB_RecvControl(data, length);
143-
}
144126
}
145127

146128
return false;

hardware/arduino/avr/libraries/HID/src/HID.h

+9
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@
2323
#include <Arduino.h>
2424
#include "PluggableUSB.h"
2525

26+
// The HID class provided in this library is a basic mechanism, designed to let enthusiasts get
27+
// a quick start with their projects. If you need more than what's implemented here (such as
28+
// bi-directional communication with the host), then you should investigate other user-contributed
29+
// libraries. In particular, have a look at: https://github.com/NicoHood/HID/wiki.
30+
// This library contains a number of implementations for Mice, Keyboards and game controllers,
31+
// perhaps one will work directly for you. If not, there are also base classes that you can use
32+
// to get a jump-start on your design.
33+
2634
#if defined(USBCON)
2735

2836
#define _USING_HID
@@ -88,6 +96,7 @@ class HIDSubDescriptor {
8896
const uint16_t length;
8997
};
9098

99+
91100
class HID_ : public PluggableUSBModule
92101
{
93102
public:

0 commit comments

Comments
 (0)