[HID] renamed HIDDescriptorListNode to HIDSubDescriptor

This commit is contained in:
Cristian Maglie 2015-10-12 12:17:42 +02:00
parent 2e755384f5
commit f42b26c257
2 changed files with 8 additions and 8 deletions

View File

@ -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;
}

View File

@ -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;