mirror of
https://github.com/arduino/Arduino.git
synced 2024-11-28 09:24:14 +01:00
[PUSB] Renamed PUSBListNode to PluggableUSBModule
This commit is contained in:
parent
80b79002fd
commit
11440d3fd7
@ -28,7 +28,7 @@ extern uint8_t _initEndpoints[];
|
||||
int PluggableUSB_::getInterface(uint8_t* interfaceCount)
|
||||
{
|
||||
int sent = 0;
|
||||
PUSBListNode* node;
|
||||
PluggableUSBModule* node;
|
||||
for (node = rootNode; node; node = node->next) {
|
||||
int res = node->getInterface(interfaceCount);
|
||||
if (res < 0)
|
||||
@ -40,7 +40,7 @@ int PluggableUSB_::getInterface(uint8_t* interfaceCount)
|
||||
|
||||
int PluggableUSB_::getDescriptor(USBSetup& setup)
|
||||
{
|
||||
PUSBListNode* node;
|
||||
PluggableUSBModule* node;
|
||||
for (node = rootNode; node; node = node->next) {
|
||||
int ret = node->getDescriptor(setup);
|
||||
// ret!=0 -> request has been processed
|
||||
@ -52,7 +52,7 @@ int PluggableUSB_::getDescriptor(USBSetup& setup)
|
||||
|
||||
bool PluggableUSB_::setup(USBSetup& setup)
|
||||
{
|
||||
PUSBListNode* node;
|
||||
PluggableUSBModule* node;
|
||||
for (node = rootNode; node; node = node->next) {
|
||||
if (node->setup(setup)) {
|
||||
return true;
|
||||
@ -61,7 +61,7 @@ bool PluggableUSB_::setup(USBSetup& setup)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool PluggableUSB_::plug(PUSBListNode *node)
|
||||
bool PluggableUSB_::plug(PluggableUSBModule *node)
|
||||
{
|
||||
if ((lastEp + node->numEndpoints) > USB_ENDPOINTS) {
|
||||
return false;
|
||||
@ -70,7 +70,7 @@ bool PluggableUSB_::plug(PUSBListNode *node)
|
||||
if (!rootNode) {
|
||||
rootNode = node;
|
||||
} else {
|
||||
PUSBListNode *current = rootNode;
|
||||
PluggableUSBModule *current = rootNode;
|
||||
while (current->next) {
|
||||
current = current->next;
|
||||
}
|
||||
|
@ -25,9 +25,9 @@
|
||||
|
||||
#if defined(USBCON)
|
||||
|
||||
class PUSBListNode {
|
||||
class PluggableUSBModule {
|
||||
public:
|
||||
PUSBListNode(uint8_t numEps, uint8_t numIfs, uint8_t *epType) :
|
||||
PluggableUSBModule(uint8_t numEps, uint8_t numIfs, uint8_t *epType) :
|
||||
numEndpoints(numEps), numInterfaces(numIfs), endpointType(epType)
|
||||
{ }
|
||||
|
||||
@ -43,7 +43,7 @@ protected:
|
||||
const uint8_t numInterfaces;
|
||||
const uint8_t *endpointType;
|
||||
|
||||
PUSBListNode *next = NULL;
|
||||
PluggableUSBModule *next = NULL;
|
||||
|
||||
friend class PluggableUSB_;
|
||||
};
|
||||
@ -51,7 +51,7 @@ protected:
|
||||
class PluggableUSB_ {
|
||||
public:
|
||||
PluggableUSB_();
|
||||
bool plug(PUSBListNode *node);
|
||||
bool plug(PluggableUSBModule *node);
|
||||
int getInterface(uint8_t* interfaceCount);
|
||||
int getDescriptor(USBSetup& setup);
|
||||
bool setup(USBSetup& setup);
|
||||
@ -59,7 +59,7 @@ public:
|
||||
private:
|
||||
uint8_t lastIf;
|
||||
uint8_t lastEp;
|
||||
PUSBListNode* rootNode;
|
||||
PluggableUSBModule* rootNode;
|
||||
};
|
||||
|
||||
// Replacement for global singleton.
|
||||
|
@ -128,7 +128,7 @@ bool HID_::setup(USBSetup& setup)
|
||||
return false;
|
||||
}
|
||||
|
||||
HID_::HID_(void) : PUSBListNode(1, 1, epType),
|
||||
HID_::HID_(void) : PluggableUSBModule(1, 1, epType),
|
||||
rootNode(NULL), descriptorSize(0),
|
||||
protocol(1), idle(1)
|
||||
{
|
||||
|
@ -83,7 +83,7 @@ public:
|
||||
const uint16_t length;
|
||||
};
|
||||
|
||||
class HID_ : public PUSBListNode
|
||||
class HID_ : public PluggableUSBModule
|
||||
{
|
||||
public:
|
||||
HID_(void);
|
||||
@ -92,7 +92,7 @@ public:
|
||||
void AppendDescriptor(HIDDescriptorListNode* node);
|
||||
|
||||
protected:
|
||||
// Implementation of the PUSBListNode
|
||||
// Implementation of the PluggableUSBModule
|
||||
int getInterface(uint8_t* interfaceCount);
|
||||
int getDescriptor(USBSetup& setup);
|
||||
bool setup(USBSetup& setup);
|
||||
|
Loading…
Reference in New Issue
Block a user