未验证 提交 aa2d2c63 编写于 作者: D Dengguiling 提交者: GitHub

[compoenets][driver][usb] fix usbhost hid issues. (#6116)

* [compoenets][driver][usb] fix usbhost hid issues.

1.Set idle function should receive an empty package.
2.Fix uinst_t reference error in hid enable function.
上级 a305edd4
/* /*
* Copyright (c) 2006-2021, RT-Thread Development Team * Copyright (c) 2006-2022, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* *
...@@ -47,9 +47,10 @@ rt_err_t rt_usbh_hid_set_idle(struct uhintf* intf, int duration, int report_id) ...@@ -47,9 +47,10 @@ rt_err_t rt_usbh_hid_set_idle(struct uhintf* intf, int duration, int report_id)
setup.wValue = (duration << 8 )| report_id; setup.wValue = (duration << 8 )| report_id;
if (rt_usb_hcd_setup_xfer(device->hcd, device->pipe_ep0_out, &setup, timeout) == 8) if (rt_usb_hcd_setup_xfer(device->hcd, device->pipe_ep0_out, &setup, timeout) == 8)
return RT_EOK; if (rt_usb_hcd_pipe_xfer(device->hcd, device->pipe_ep0_in, RT_NULL, 0, timeout) == 0)
else return RT_EOK;
return -RT_FALSE;
return -RT_FALSE;
} }
/** /**
...@@ -341,7 +342,7 @@ static rt_err_t rt_usbh_hid_enable(void* arg) ...@@ -341,7 +342,7 @@ static rt_err_t rt_usbh_hid_enable(void* arg)
if(!(ep_desc->bEndpointAddress & USB_DIR_IN)) continue; if(!(ep_desc->bEndpointAddress & USB_DIR_IN)) continue;
ret = rt_usb_hcd_alloc_pipe(intf->device->hcd, &hid->pipe_in, ret = rt_usb_hcd_alloc_pipe(intf->device->hcd, &hid->pipe_in,
intf, ep_desc); intf->device, ep_desc);
if(ret != RT_EOK) return ret; if(ret != RT_EOK) return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册