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: USBHostHID/USBHostMouse.cpp
- Revision:
- 28:a55c5a98d5e9
- Parent:
- 24:868cbfe611a7
diff -r aa2fd412f1d3 -r a55c5a98d5e9 USBHostHID/USBHostMouse.cpp --- a/USBHostHID/USBHostMouse.cpp Tue Dec 02 15:16:39 2014 +0000 +++ b/USBHostHID/USBHostMouse.cpp Wed Dec 03 13:32:37 2014 +0000 @@ -21,6 +21,16 @@ USBHostMouse::USBHostMouse() { host = USBHost::getHostInst(); init(); + + report = host->getSafeMem(4); +} + +USBHostMouse::~USBHostMouse() +{ + if (report != NULL) { + host->returnSafeMem(report); + report = NULL; + } } void USBHostMouse::init() { @@ -109,8 +119,9 @@ y = report[2]; z = report[3]; - if (dev) + if (dev) { host->interruptRead(dev, int_in, report, len_listen, false); + } } /*virtual*/ void USBHostMouse::setVidPid(uint16_t vid, uint16_t pid)