mirror of https://github.com/ARMmbed/mbed-os.git
Fixed readNB() bug
Fixed a race condition with readNB() in USBHID that caused reports to be periodically returned empty.pull/236/head
parent
b6fadb4e11
commit
f0453b3e07
|
|
@ -59,6 +59,9 @@ bool USBHID::readNB(HID_REPORT *report)
|
|||
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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue