diff options
author | NicoHood <NicoHood@users.noreply.github.com> | 2015-10-07 19:02:40 +0200 |
---|---|---|
committer | NicoHood <NicoHood@users.noreply.github.com> | 2015-10-07 19:02:40 +0200 |
commit | dfe89ddd015f072e279d38354d60e4882c15bdb0 (patch) | |
tree | a00dea9638a58afd0d47226d018f29b51cc7218f /cores/arduino/PluggableUSB.h | |
parent | 4a1921932de509ea64c8521ab610f7bb1160884c (diff) |
[PUSB] Made getDescriptor() and setup() more flexible
Alternatively we can only pass the wIndex to getDescriptor but I suggest to just pass the pointer aka reference of the whole setup.
In guess (havent tested this) that this results in more or less the code size but its a) idential with the other functions and b) we late have more flexibility here.
The Code got a quick SerialKeyboard.ino test
Diffstat (limited to 'cores/arduino/PluggableUSB.h')
-rw-r--r-- | cores/arduino/PluggableUSB.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/cores/arduino/PluggableUSB.h b/cores/arduino/PluggableUSB.h index b7c52d6..d12c4c4 100644 --- a/cores/arduino/PluggableUSB.h +++ b/cores/arduino/PluggableUSB.h @@ -35,9 +35,9 @@ public: inline uint8_t endpoint() const { return pluggedEndpoint; } protected: - virtual bool setup(USBSetup& setup, uint8_t interfaceNum) = 0; + virtual bool setup(USBSetup& setup) = 0; virtual int getInterface(uint8_t* interfaceCount) = 0; - virtual int getDescriptor(int8_t t) = 0; + virtual int getDescriptor(USBSetup& setup) = 0; uint8_t pluggedInterface; uint8_t pluggedEndpoint; @@ -56,8 +56,8 @@ public: PluggableUSB_(); bool plug(PUSBListNode *node); int getInterface(uint8_t* interfaceCount); - int getDescriptor(int8_t type); - bool setup(USBSetup& setup, uint8_t interfaceNum); + int getDescriptor(USBSetup& setup); + bool setup(USBSetup& setup); private: uint8_t lastIf; |