Skip to content

Commit 87bbaaa

Browse files
committed
fix PUSB_getInterface return value
1 parent 8147551 commit 87bbaaa

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Diff for: cores/arduino/USB/PluggableUSB.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ int PUSB_GetInterface(uint8_t* interfaceNum)
4040
int ret = 0;
4141
PUSBListNode* node = rootNode;
4242
for (uint8_t i=0; i<modules_count; i++) {
43-
ret = node->cb->getInterface(interfaceNum);
43+
ret += node->cb->getInterface(interfaceNum);
4444
node = node->next;
4545
}
4646
return ret;

Diff for: cores/arduino/USB/USBCore.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,8 @@ uint32_t USBDeviceClass::sendConfiguration(uint32_t maxlen)
156156
return true;
157157
}
158158

159+
total = 0;
160+
159161
packMessages(true);
160162
sendControl(&config, sizeof(ConfigDescriptor));
161163
SendInterfaces(&total);

0 commit comments

Comments
 (0)