From 29a3c8561f31bb8d743cfb506b4a17071e0eb8c4 Mon Sep 17 00:00:00 2001 From: nickboers <43919514+nickboers@users.noreply.github.com> Date: Sat, 6 Oct 2018 21:01:41 -0400 Subject: [PATCH] Increase HID descriptor report size variable type In the process of implementing a USB host application to work with a UPS, I found the report descriptor to be well in excess of the 255 bytes allowed by the uint8 used for bytesTransferred at line 133. --- src/usb_host_hid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/usb_host_hid.c b/src/usb_host_hid.c index e84ee7e..90122a5 100644 --- a/src/usb_host_hid.c +++ b/src/usb_host_hid.c @@ -130,7 +130,7 @@ typedef struct _USB_HID_TRANSFER_INFO uint8_t state; // State of the endpoint. uint16_t reportId; // Report ID of the current transfer. uint8_t *userData; // Data pointer to application buffer. - uint8_t bytesTransferred; // Number of bytes transferred to/from the user's data buffer. + uint16_t bytesTransferred; // Number of bytes transferred to/from the user's data buffer. uint8_t endpoint; // Endpoint to use for the transfer. uint8_t reportSize; // Size of report currently requested for transfer. uint8_t interface; // Interface number of current transfer.