Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of USBHostWANDongle_bleedingedge by
Diff: USBHost/USBDeviceConnected.cpp
- Revision:
- 2:a8b2d0cd9bbd
- Parent:
- 0:ae46a0638b2c
- Child:
- 9:c9e9817c398c
diff -r 49df46e3295c -r a8b2d0cd9bbd USBHost/USBDeviceConnected.cpp --- a/USBHost/USBDeviceConnected.cpp Fri May 25 09:31:41 2012 +0000 +++ b/USBHost/USBDeviceConnected.cpp Tue Jun 26 13:43:54 2012 +0000 @@ -95,13 +95,20 @@ -Endpoint * USBDeviceConnected::getEndpoint(uint8_t intf_nb, ENDPOINT_TYPE type, ENDPOINT_DIRECTION dir) { +Endpoint * USBDeviceConnected::getEndpoint(uint8_t intf_nb, ENDPOINT_TYPE type, ENDPOINT_DIRECTION dir, uint8_t index) { if (intf_nb >= MAX_INTF) { return NULL; } for (int i = 0; i < MAX_ENDPOINT_PER_INTERFACE; i++) { if ((intf[intf_nb].ep[i]->getType() == type) && (intf[intf_nb].ep[i]->getDir() == dir)) { - return intf[intf_nb].ep[i]; + if(index) + { + index--; + } + else + { + return intf[intf_nb].ep[i]; + } } } return NULL;