From cf4d7e1ffb3fe7909a0ed7774df514554eecfe8a Mon Sep 17 00:00:00 2001 From: NicoHood Date: Sun, 25 Oct 2015 08:24:55 +0100 Subject: [PATCH] Added return value to HID SendReport --- hardware/arduino/avr/libraries/HID/HID.cpp | 8 +++++--- hardware/arduino/avr/libraries/HID/HID.h | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/hardware/arduino/avr/libraries/HID/HID.cpp b/hardware/arduino/avr/libraries/HID/HID.cpp index ce9a6a08e..3a4269999 100644 --- a/hardware/arduino/avr/libraries/HID/HID.cpp +++ b/hardware/arduino/avr/libraries/HID/HID.cpp @@ -86,10 +86,12 @@ void HID_::AppendDescriptor(HIDSubDescriptor *node) descriptorSize += node->length; } -void HID_::SendReport(uint8_t id, const void* data, int len) +int HID_::SendReport(uint8_t id, const void* data, int len) { - USB_Send(pluggedEndpoint, &id, 1); - USB_Send(pluggedEndpoint | TRANSFER_RELEASE, data, len); + int ret = 0; + ret += USB_Send(pluggedEndpoint, &id, 1); + ret += USB_Send(pluggedEndpoint | TRANSFER_RELEASE, data, len); + return ret; } bool HID_::setup(USBSetup& setup) diff --git a/hardware/arduino/avr/libraries/HID/HID.h b/hardware/arduino/avr/libraries/HID/HID.h index b6638c889..a9b3f58f2 100644 --- a/hardware/arduino/avr/libraries/HID/HID.h +++ b/hardware/arduino/avr/libraries/HID/HID.h @@ -88,7 +88,7 @@ class HID_ : public PluggableUSBModule public: HID_(void); int begin(void); - void SendReport(uint8_t id, const void* data, int len); + int SendReport(uint8_t id, const void* data, int len); void AppendDescriptor(HIDSubDescriptor* node); protected: