From 34a75d94163b385d20b37f5cffd2ffe241c6dd7d Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Tue, 29 Sep 2015 17:59:54 +0200 Subject: [PUSB] Selected interface and endpoint are now part of PUSBListNode The method int8_t PluggableUSB::addFunction(PUSBListNode *, uint8_t *) has been changed to bool PluggableUSB::plug(PUSBListNode *node) since both EP and Interfaces are now saved directly into node --- cores/arduino/PluggableUSB.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'cores/arduino/PluggableUSB.cpp') 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; inumEndpoints; i++) { _initEndpoints[lastEp] = node->endpointType[i]; lastEp++; } modules_count++; - return lastEp - node->numEndpoints; + return true; // restart USB layer??? } -- cgit v1.2.3-18-g5258