aboutsummaryrefslogtreecommitdiff
path: root/cores/arduino/PluggableUSB.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cores/arduino/PluggableUSB.cpp')
-rw-r--r--cores/arduino/PluggableUSB.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/cores/arduino/PluggableUSB.cpp b/cores/arduino/PluggableUSB.cpp
index 9dc334e..b27146b 100644
--- a/cores/arduino/PluggableUSB.cpp
+++ b/cores/arduino/PluggableUSB.cpp
@@ -68,10 +68,10 @@ bool PluggableUSB_::setup(USBSetup& setup, u8 j)
return ret;
}
-int8_t PluggableUSB_::addFunction(PUSBListNode *node, u8* interface)
+bool PluggableUSB_::plug(PUSBListNode *node)
{
if (modules_count >= MAX_MODULES) {
- return 0;
+ return false;
}
if (modules_count == 0) {
@@ -84,14 +84,15 @@ int8_t PluggableUSB_::addFunction(PUSBListNode *node, u8* interface)
current->next = node;
}
- *interface = lastIf;
+ node->pluggedInterface = lastIf;
+ node->pluggedEndpoint = lastEp;
lastIf += node->numInterfaces;
- for ( u8 i = 0; i< node->numEndpoints; i++) {
+ for (uint8_t i=0; i<node->numEndpoints; i++) {
_initEndpoints[lastEp] = node->endpointType[i];
lastEp++;
}
modules_count++;
- return lastEp - node->numEndpoints;
+ return true;
// restart USB layer???
}