mirror of
https://github.com/arduino/Arduino.git
synced 2025-01-18 07:52:14 +01:00
fix pluggableUSB linked list
This commit is contained in:
parent
8a45883230
commit
6a9568d3e1
@ -34,7 +34,6 @@ extern u8 _initEndpoints[];
|
|||||||
static u8 modules_count = 0;
|
static u8 modules_count = 0;
|
||||||
|
|
||||||
static PUSBListNode* rootNode = NULL;
|
static PUSBListNode* rootNode = NULL;
|
||||||
static PUSBListNode* lastNode = NULL;
|
|
||||||
|
|
||||||
int PUSB_GetInterface(u8* interfaceNum)
|
int PUSB_GetInterface(u8* interfaceNum)
|
||||||
{
|
{
|
||||||
@ -77,9 +76,12 @@ int8_t PUSB_AddFunction(PUSBListNode *node, u8* interface)
|
|||||||
|
|
||||||
if (modules_count == 0) {
|
if (modules_count == 0) {
|
||||||
rootNode = node;
|
rootNode = node;
|
||||||
lastNode = node;
|
|
||||||
} else {
|
} else {
|
||||||
lastNode->next = node;
|
PUSBListNode *current = rootNode;
|
||||||
|
while(current->next != NULL) {
|
||||||
|
current = current->next;
|
||||||
|
}
|
||||||
|
current->next = node;
|
||||||
}
|
}
|
||||||
|
|
||||||
*interface = lastIf;
|
*interface = lastIf;
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
#if defined(USBCON)
|
#if defined(USBCON)
|
||||||
|
|
||||||
typedef struct
|
typedef struct __attribute__((packed))
|
||||||
{
|
{
|
||||||
bool (*setup)(USBSetup& setup, u8 i);
|
bool (*setup)(USBSetup& setup, u8 i);
|
||||||
int (*getInterface)(u8* interfaceNum);
|
int (*getInterface)(u8* interfaceNum);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user