fix pluggableUSB linked list
This commit is contained in:
parent
862febf3e2
commit
b0bdb47694
|
@ -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;
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
#if defined(USBCON)
|
||||
|
||||
typedef struct
|
||||
typedef struct __attribute__((packed))
|
||||
{
|
||||
bool (*setup)(USBSetup& setup, u8 i);
|
||||
int (*getInterface)(u8* interfaceNum);
|
||||
|
|
Loading…
Reference in New Issue