Skip to content

Commit cf4d7e1

Browse files
NicoHoodcmaglie
authored andcommitted
Added return value to HID SendReport
1 parent 0e0c50d commit cf4d7e1

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

hardware/arduino/avr/libraries/HID/HID.cpp

+5-3
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,12 @@ void HID_::AppendDescriptor(HIDSubDescriptor *node)
8686
descriptorSize += node->length;
8787
}
8888

89-
void HID_::SendReport(uint8_t id, const void* data, int len)
89+
int HID_::SendReport(uint8_t id, const void* data, int len)
9090
{
91-
USB_Send(pluggedEndpoint, &id, 1);
92-
USB_Send(pluggedEndpoint | TRANSFER_RELEASE, data, len);
91+
int ret = 0;
92+
ret += USB_Send(pluggedEndpoint, &id, 1);
93+
ret += USB_Send(pluggedEndpoint | TRANSFER_RELEASE, data, len);
94+
return ret;
9395
}
9496

9597
bool HID_::setup(USBSetup& setup)

hardware/arduino/avr/libraries/HID/HID.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ class HID_ : public PluggableUSBModule
8888
public:
8989
HID_(void);
9090
int begin(void);
91-
void SendReport(uint8_t id, const void* data, int len);
91+
int SendReport(uint8_t id, const void* data, int len);
9292
void AppendDescriptor(HIDSubDescriptor* node);
9393

9494
protected:

0 commit comments

Comments
 (0)