1
0
mirror of https://github.com/arduino/Arduino.git synced 2025-01-29 18:52:13 +01:00

[PUSB] Fixed return value for HID_::SendReport

This commit is contained in:
Cristian Maglie 2015-10-30 13:00:33 +01:00
parent 741d5dff9e
commit 21168e1b5d

View File

@ -88,11 +88,11 @@ void HID_::AppendDescriptor(HIDSubDescriptor *node)
int HID_::SendReport(uint8_t id, const void* data, int len)
{
auto ret = USB_Send(pluggedEndpoint, &id, 1);
if(ret >= 0){
ret += USB_Send(pluggedEndpoint | TRANSFER_RELEASE, data, len);
}
return ret;
auto ret = USB_Send(pluggedEndpoint, &id, 1);
if (ret < 0) return ret;
auto ret2 = USB_Send(pluggedEndpoint | TRANSFER_RELEASE, data, len);
if (ret2 < 0) return ret2;
return ret + ret2;
}
bool HID_::setup(USBSetup& setup)