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: DMSupport DMSupport DMSupport DMSupport
Fork of DM_USBHost by
Diff: USBHostHID/USBHostMouse.cpp
- Revision:
- 28:a55c5a98d5e9
- Parent:
- 24:868cbfe611a7
--- 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)
