fix pluggableUSB linked list

This commit is contained in:
Martino Facchin 2015-07-02 12:08:53 +02:00 committed by Cristian Maglie
parent 862febf3e2
commit b0bdb47694
2 changed files with 6 additions and 4 deletions

View File

@ -34,7 +34,6 @@ extern u8 _initEndpoints[];
static u8 modules_count = 0;
static PUSBListNode* rootNode = NULL;
static PUSBListNode* lastNode = NULL;
int PUSB_GetInterface(u8* interfaceNum)
{
@ -77,9 +76,12 @@ int8_t PUSB_AddFunction(PUSBListNode *node, u8* interface)
if (modules_count == 0) {
rootNode = node;
lastNode = node;
} else {
lastNode->next = node;
PUSBListNode *current = rootNode;
while(current->next != NULL) {
current = current->next;
}
current->next = node;
}
*interface = lastIf;

View File

@ -25,7 +25,7 @@
#if defined(USBCON)
typedef struct
typedef struct __attribute__((packed))
{
bool (*setup)(USBSetup& setup, u8 i);
int (*getInterface)(u8* interfaceNum);