Adaptation of the official mbed USBHost repository to work with the LPC4088 Display Module
Dependents: DMSupport DMSupport DMSupport DMSupport
Fork of DM_USBHost by
Diff: USBHostHub/USBHostHub.cpp
- Revision:
- 33:819bbf04163b
- Parent:
- 32:f2d129436056
diff -r f2d129436056 -r 819bbf04163b USBHostHub/USBHostHub.cpp --- a/USBHostHub/USBHostHub.cpp Wed Oct 23 06:58:55 2019 +0000 +++ b/USBHostHub/USBHostHub.cpp Mon Nov 04 14:30:07 2019 +0000 @@ -53,8 +53,6 @@ USBHostHub::USBHostHub() { host = NULL; init(); - - buf = host->getSafeMem(sizeof(HubDescriptor)); } USBHostHub::~USBHostHub() @@ -78,6 +76,10 @@ for (int i = 0; i < MAX_HUB_PORT; i++) { device_children[i] = NULL; } + + if (host != NULL) { + buf = host->getSafeMem(sizeof(HubDescriptor)); + } } void USBHostHub::setHost(USBHost * host_) {