summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafaël Carré <rafael.carre@gmail.com>2011-12-29 21:49:29 +0000
committerRafaël Carré <rafael.carre@gmail.com>2011-12-29 21:49:29 +0000
commit6a6269ffd8dfaf921588bae47cd55716abb78abb (patch)
treebc0f6e2cbe4cb038720c2891b5067451be4d3ffe
parentc17b0af89edb9818a195d72d80a41f457cc54a39 (diff)
usb_hid: fix r31457
descriptor_hid_get() updates its parameter so we need to take its address the update is hidden inside PACK_DATA macro Fix HID on the Fuze+ Reported by jlbiasini git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31466 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/usbstack/usb_hid.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/firmware/usbstack/usb_hid.c b/firmware/usbstack/usb_hid.c
index 46baff8222..b89e46f291 100644
--- a/firmware/usbstack/usb_hid.c
+++ b/firmware/usbstack/usb_hid.c
@@ -554,14 +554,14 @@ static size_t descriptor_report_get(unsigned char *dest)
return (size_t)(report - dest);
}
-static void descriptor_hid_get(unsigned char *dest)
+static void descriptor_hid_get(unsigned char **dest)
{
hid_descriptor.wDescriptorLength0= descriptor_report_get(report_descriptor);
logf("hid: desc len %u", hid_descriptor.wDescriptorLength0);
buf_dump(report_descriptor, hid_descriptor.wDescriptorLength0, "desc");
- PACK_DATA(dest, hid_descriptor);
+ PACK_DATA(*dest, hid_descriptor);
}
int usb_hid_get_config_descriptor(unsigned char *dest, int max_packet_size)
@@ -577,7 +577,7 @@ int usb_hid_get_config_descriptor(unsigned char *dest, int max_packet_size)
PACK_DATA(dest, interface_descriptor);
/* HID descriptor */
- descriptor_hid_get(dest);
+ descriptor_hid_get(&dest);
/* Endpoint descriptor */
endpoint_descriptor.wMaxPacketSize = 8;
@@ -703,7 +703,7 @@ bool usb_hid_control_request(struct usb_ctrlrequest *req, unsigned char *dest)
switch (type)
{
case USB_DT_HID:
- descriptor_hid_get(dest);
+ descriptor_hid_get(&dest);
break;
case USB_DT_REPORT:
len = descriptor_report_get(report_descriptor);