Version of USBDevice that works for KL25Z on Mbed OS2.

Fork of USBDevice by mbed official

Revision:
21:ee9f2fa6bdbc
Parent:
11:eeb3cbbaa996
Child:
25:7c72828865f3
diff -r d38b72fed893 -r ee9f2fa6bdbc USBHID/USBHID.cpp
--- a/USBHID/USBHID.cpp	Thu Feb 27 09:45:46 2014 +0000
+++ b/USBHID/USBHID.cpp	Thu Mar 27 09:45:42 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;