From 7302965552a77c1af000e3870848b3cc35670c51 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Tue, 29 Sep 2015 16:40:27 +0200 Subject: [PUSB] PUSBCallback struct has been merged into PUSBListNode This slightly simplifies PluggableUSB API. --- cores/arduino/PluggableUSB.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'cores/arduino/PluggableUSB.cpp') diff --git a/cores/arduino/PluggableUSB.cpp b/cores/arduino/PluggableUSB.cpp index 857a27f..9597adc 100644 --- a/cores/arduino/PluggableUSB.cpp +++ b/cores/arduino/PluggableUSB.cpp @@ -40,7 +40,7 @@ int PUSB_GetInterface(u8* interfaceNum) int ret = 0; PUSBListNode* node = rootNode; for (u8 i=0; icb->getInterface(interfaceNum); + ret = node->getInterface(interfaceNum); node = node->next; } return ret; @@ -51,7 +51,7 @@ int PUSB_GetDescriptor(int8_t t) int ret = 0; PUSBListNode* node = rootNode; for (u8 i=0; icb->getDescriptor(t); + ret = node->getDescriptor(t); node = node->next; } return ret; @@ -62,7 +62,7 @@ bool PUSB_Setup(USBSetup& setup, u8 j) bool ret = false; PUSBListNode* node = rootNode; for (u8 i=0; icb->setup(setup, j); + ret = node->setup(setup, j); node = node->next; } return ret; @@ -85,16 +85,16 @@ int8_t PUSB_AddFunction(PUSBListNode *node, u8* interface) } *interface = lastIf; - lastIf += node->cb->numInterfaces; - for ( u8 i = 0; i< node->cb->numEndpoints; i++) { - _initEndpoints[lastEp] = node->cb->endpointType[i]; + lastIf += node->numInterfaces; + for ( u8 i = 0; i< node->numEndpoints; i++) { + _initEndpoints[lastEp] = node->endpointType[i]; lastEp++; } modules_count++; - return lastEp - node->cb->numEndpoints; + return lastEp - node->numEndpoints; // restart USB layer??? } #endif -#endif /* if defined(USBCON) */ \ No newline at end of file +#endif /* if defined(USBCON) */ -- cgit v1.2.3-18-g5258