mirror of
https://github.com/arduino/Arduino.git
synced 2025-03-14 11:29:26 +01:00
[PUSB] The latest fields are now set via constructor
This commit is contained in:
parent
0dfa815ce4
commit
0369b8ec33
@ -27,10 +27,9 @@
|
|||||||
|
|
||||||
class PUSBListNode {
|
class PUSBListNode {
|
||||||
public:
|
public:
|
||||||
PUSBListNode() { }
|
PUSBListNode(int8_t numEps, int8_t numIfs, uint8_t *epType) :
|
||||||
int8_t numEndpoints;
|
numEndpoints(numEps), numInterfaces(numIfs), endpointType(epType)
|
||||||
int8_t numInterfaces;
|
{ }
|
||||||
uint8_t *endpointType;
|
|
||||||
|
|
||||||
inline uint8_t interface() const { return pluggedInterface; }
|
inline uint8_t interface() const { return pluggedInterface; }
|
||||||
inline int8_t endpoint() const { return pluggedEndpoint; }
|
inline int8_t endpoint() const { return pluggedEndpoint; }
|
||||||
@ -43,6 +42,10 @@ protected:
|
|||||||
uint8_t pluggedInterface;
|
uint8_t pluggedInterface;
|
||||||
int8_t pluggedEndpoint;
|
int8_t pluggedEndpoint;
|
||||||
|
|
||||||
|
const int8_t numEndpoints;
|
||||||
|
const int8_t numInterfaces;
|
||||||
|
const uint8_t *endpointType;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PUSBListNode *next = NULL;
|
PUSBListNode *next = NULL;
|
||||||
|
|
||||||
|
@ -128,12 +128,9 @@ bool HID_::setup(USBSetup& setup, uint8_t i)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
HID_::HID_(void)
|
HID_::HID_(void) : PUSBListNode(1, 1, epType)
|
||||||
{
|
{
|
||||||
numEndpoints = 1;
|
// XXX: Shall this be done in PUSBListNode(...) constructor?
|
||||||
numInterfaces = 1;
|
|
||||||
endpointType = epType;
|
|
||||||
|
|
||||||
PluggableUSB.plug(this);
|
PluggableUSB.plug(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user