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.
Dependents: DISCO-F746NG_USB_Host
Fork of KL46Z-USBHost by
Diff: USBHost/USBHost.cpp
- Revision:
- 24:5396b6a93262
- Parent:
- 18:61554f238584
- Child:
- 25:7d6d9fc471bf
diff -r 4ab8bc835303 -r 5396b6a93262 USBHost/USBHost.cpp
--- a/USBHost/USBHost.cpp Sun May 01 03:18:11 2016 +0000
+++ b/USBHost/USBHost.cpp Mon Jun 13 17:21:07 2016 +0000
@@ -23,9 +23,13 @@
USBHost* USBHost::inst = NULL;
-USBHost* USBHost::getHostInst() {
+USBHost* USBHost::getHostInst(int IF_Number) {
if (inst == NULL) {
- inst = new USBHost();
+ inst = new USBHost(IF_Number);
+ inst->init();
+ }
+ if(inst->IF_N!=IF_Number) {
+ inst = new USBHost(IF_Number);
inst->init();
}
return inst;
@@ -38,7 +42,8 @@
}
}
-USBHost::USBHost() {
+USBHost::USBHost(int InterfaceNumber):USBHALHost(InterfaceNumber) {
+
}
/* virtual */ bool USBHost::addDevice(USBDeviceConnected* parent, int port, bool lowSpeed) {
@@ -148,6 +153,7 @@
bool parsing_intf = false;
uint8_t current_intf = 0;
EndpointDescriptor* ep_desc;
+ int epsetup;
while (index < len) {
len_desc = conf_descr[index];
@@ -179,6 +185,7 @@
ep->init(type, dir, ep_desc->wMaxPacketSize, ep_desc->bEndpointAddress);
USB_DBG("ADD USBEndpoint %p, on interf %d on device %p", ep, current_intf, dev);
dev->addEndpoint(current_intf, ep);
+ epsetup=epint_setup(ep);
}
}
break;
