mirror of
https://github.com/arduino/Arduino.git
synced 2025-02-18 12:54:25 +01:00
[HID] renamed HIDDescriptorListNode to HIDSubDescriptor
This commit is contained in:
parent
11440d3fd7
commit
a151349a01
@ -47,7 +47,7 @@ int HID_::getDescriptor(USBSetup& setup)
|
||||
if (setup.wIndex != pluggedInterface) { return 0; }
|
||||
|
||||
int total = 0;
|
||||
HIDDescriptorListNode* node;
|
||||
HIDSubDescriptor* node;
|
||||
for (node = rootNode; node; node = node->next) {
|
||||
int res = USB_SendControl(TRANSFER_PGM, node->data, node->length);
|
||||
if (res == -1)
|
||||
@ -57,12 +57,12 @@ int HID_::getDescriptor(USBSetup& setup)
|
||||
return total;
|
||||
}
|
||||
|
||||
void HID_::AppendDescriptor(HIDDescriptorListNode *node)
|
||||
void HID_::AppendDescriptor(HIDSubDescriptor *node)
|
||||
{
|
||||
if (!rootNode) {
|
||||
rootNode = node;
|
||||
} else {
|
||||
HIDDescriptorListNode *current = rootNode;
|
||||
HIDSubDescriptor *current = rootNode;
|
||||
while (current->next) {
|
||||
current = current->next;
|
||||
}
|
||||
|
@ -74,10 +74,10 @@ typedef struct
|
||||
EndpointDescriptor in;
|
||||
} HIDDescriptor;
|
||||
|
||||
class HIDDescriptorListNode {
|
||||
class HIDSubDescriptor {
|
||||
public:
|
||||
HIDDescriptorListNode *next = NULL;
|
||||
HIDDescriptorListNode(const void *d, const uint16_t l) : data(d), length(l) { }
|
||||
HIDSubDescriptor *next = NULL;
|
||||
HIDSubDescriptor(const void *d, const uint16_t l) : data(d), length(l) { }
|
||||
|
||||
const void* data;
|
||||
const uint16_t length;
|
||||
@ -89,7 +89,7 @@ public:
|
||||
HID_(void);
|
||||
int begin(void);
|
||||
void SendReport(uint8_t id, const void* data, int len);
|
||||
void AppendDescriptor(HIDDescriptorListNode* node);
|
||||
void AppendDescriptor(HIDSubDescriptor* node);
|
||||
|
||||
protected:
|
||||
// Implementation of the PluggableUSBModule
|
||||
@ -100,7 +100,7 @@ protected:
|
||||
private:
|
||||
uint8_t epType[1];
|
||||
|
||||
HIDDescriptorListNode* rootNode;
|
||||
HIDSubDescriptor* rootNode;
|
||||
uint16_t descriptorSize;
|
||||
|
||||
uint8_t protocol;
|
||||
|
@ -62,7 +62,7 @@ static const uint8_t _hidReportDescriptor[] PROGMEM = {
|
||||
|
||||
Keyboard_::Keyboard_(void)
|
||||
{
|
||||
static HIDDescriptorListNode node(_hidReportDescriptor, sizeof(_hidReportDescriptor));
|
||||
static HIDSubDescriptor node(_hidReportDescriptor, sizeof(_hidReportDescriptor));
|
||||
HID().AppendDescriptor(&node);
|
||||
}
|
||||
|
||||
|
@ -62,7 +62,7 @@ static const uint8_t _hidReportDescriptor[] PROGMEM = {
|
||||
|
||||
Mouse_::Mouse_(void) : _buttons(0)
|
||||
{
|
||||
static HIDDescriptorListNode node(_hidReportDescriptor, sizeof(_hidReportDescriptor));
|
||||
static HIDSubDescriptor node(_hidReportDescriptor, sizeof(_hidReportDescriptor));
|
||||
HID().AppendDescriptor(&node);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user