USB HID device for CMSIS-DAP

Dependents:   lpcterm2 Simple-CMSIS-DAP

Files at this revision

API Documentation at this revision

Comitter:
va009039
Date:
Tue Apr 01 23:28:19 2014 +0000
Parent:
0:6b9154ed73c6
Child:
2:7dee016756ce
Commit message:
Fixed readNB() bug (not tested)

Changed in this revision

USBDAP.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/USBDAP.cpp	Sat Sep 14 11:19:17 2013 +0000
+++ b/USBDAP.cpp	Tue Apr 01 23:28:19 2014 +0000
@@ -59,6 +59,9 @@
     uint32_t bytesRead = 0;
     bool result;
     result = USBDevice::readEP_NB(EPINT_OUT, report->data, &bytesRead, MAX_HID_REPORT_SIZE);
+    // if readEP_NB did not succeed, does not issue a readStart
+    if (!result)
+        return false;
     report->length = bytesRead;
     if(!readStart(EPINT_OUT, MAX_HID_REPORT_SIZE))
         return false;