[PUSB] Fixed return value for HID_::SendReport
This commit is contained in:
parent
25d1a2a67c
commit
67be29640d
|
@ -89,10 +89,10 @@ void HID_::AppendDescriptor(HIDSubDescriptor *node)
|
||||||
int HID_::SendReport(uint8_t id, const void* data, int len)
|
int HID_::SendReport(uint8_t id, const void* data, int len)
|
||||||
{
|
{
|
||||||
auto ret = USB_Send(pluggedEndpoint, &id, 1);
|
auto ret = USB_Send(pluggedEndpoint, &id, 1);
|
||||||
if(ret >= 0){
|
if (ret < 0) return ret;
|
||||||
ret += USB_Send(pluggedEndpoint | TRANSFER_RELEASE, data, len);
|
auto ret2 = USB_Send(pluggedEndpoint | TRANSFER_RELEASE, data, len);
|
||||||
}
|
if (ret2 < 0) return ret2;
|
||||||
return ret;
|
return ret + ret2;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool HID_::setup(USBSetup& setup)
|
bool HID_::setup(USBSetup& setup)
|
||||||
|
|
Loading…
Reference in New Issue