aboutsummaryrefslogtreecommitdiff
path: root/cores/arduino/PluggableUSB.cpp
diff options
context:
space:
mode:
authorNicoHood <NicoHood@users.noreply.github.com>2015-10-07 19:02:40 +0200
committerNicoHood <NicoHood@users.noreply.github.com>2015-10-07 19:02:40 +0200
commitdfe89ddd015f072e279d38354d60e4882c15bdb0 (patch)
treea00dea9638a58afd0d47226d018f29b51cc7218f /cores/arduino/PluggableUSB.cpp
parent4a1921932de509ea64c8521ab610f7bb1160884c (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.cpp')
-rw-r--r--cores/arduino/PluggableUSB.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/cores/arduino/PluggableUSB.cpp b/cores/arduino/PluggableUSB.cpp
index 95d4079..21dc7a8 100644
--- a/cores/arduino/PluggableUSB.cpp
+++ b/cores/arduino/PluggableUSB.cpp
@@ -38,11 +38,11 @@ int PluggableUSB_::getInterface(uint8_t* interfaceCount)
return sent;
}
-int PluggableUSB_::getDescriptor(int8_t type)
+int PluggableUSB_::getDescriptor(USBSetup& setup)
{
PUSBListNode* node;
for (node = rootNode; node; node = node->next) {
- int ret = node->getDescriptor(type);
+ int ret = node->getDescriptor(setup);
// ret!=0 -> request has been processed
if (ret)
return ret;
@@ -50,11 +50,11 @@ int PluggableUSB_::getDescriptor(int8_t type)
return 0;
}
-bool PluggableUSB_::setup(USBSetup& setup, uint8_t interfaceNum)
+bool PluggableUSB_::setup(USBSetup& setup)
{
PUSBListNode* node;
for (node = rootNode; node; node = node->next) {
- if (node->setup(setup, interfaceNum)) {
+ if (node->setup(setup)) {
return true;
}
}