forked from len0rd/rockbox
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
This commit is contained in:
parent
c17b0af89e
commit
6a6269ffd8
1 changed files with 4 additions and 4 deletions
|
@ -554,14 +554,14 @@ static size_t descriptor_report_get(unsigned char *dest)
|
||||||
return (size_t)(report - 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);
|
hid_descriptor.wDescriptorLength0= descriptor_report_get(report_descriptor);
|
||||||
|
|
||||||
logf("hid: desc len %u", hid_descriptor.wDescriptorLength0);
|
logf("hid: desc len %u", hid_descriptor.wDescriptorLength0);
|
||||||
buf_dump(report_descriptor, hid_descriptor.wDescriptorLength0, "desc");
|
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)
|
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);
|
PACK_DATA(dest, interface_descriptor);
|
||||||
|
|
||||||
/* HID descriptor */
|
/* HID descriptor */
|
||||||
descriptor_hid_get(dest);
|
descriptor_hid_get(&dest);
|
||||||
|
|
||||||
/* Endpoint descriptor */
|
/* Endpoint descriptor */
|
||||||
endpoint_descriptor.wMaxPacketSize = 8;
|
endpoint_descriptor.wMaxPacketSize = 8;
|
||||||
|
@ -703,7 +703,7 @@ bool usb_hid_control_request(struct usb_ctrlrequest *req, unsigned char *dest)
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
case USB_DT_HID:
|
case USB_DT_HID:
|
||||||
descriptor_hid_get(dest);
|
descriptor_hid_get(&dest);
|
||||||
break;
|
break;
|
||||||
case USB_DT_REPORT:
|
case USB_DT_REPORT:
|
||||||
len = descriptor_report_get(report_descriptor);
|
len = descriptor_report_get(report_descriptor);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue