diff options
| author | liruncong <[email protected]> | 2018-09-02 22:39:51 +0800 |
|---|---|---|
| committer | liruncong <[email protected]> | 2018-09-02 22:39:51 +0800 |
| commit | d3c08afd75a9bbb8533b6dda3faa9087914affb7 (patch) | |
| tree | a43c6913bcf027648d96eeb5b35025248c1ad914 /components/drivers/usb/usbdevice | |
| parent | 923d6fe33d084a3a60afbf7d9e6785e44342b21f (diff) | |
1. 保留目前未用到的rt_usbd_ep_unassign函数,暂时移除static属性,消除警告.
2. 修改一处存在多余括号问题. armclang有警告发出.
Diffstat (limited to 'components/drivers/usb/usbdevice')
| -rw-r--r-- | components/drivers/usb/usbdevice/core/core.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/components/drivers/usb/usbdevice/core/core.c b/components/drivers/usb/usbdevice/core/core.c index 4a4f370f16..1900673976 100644 --- a/components/drivers/usb/usbdevice/core/core.c +++ b/components/drivers/usb/usbdevice/core/core.c @@ -36,6 +36,7 @@ static rt_list_t device_list; static rt_size_t rt_usbd_ep_write(udevice_t device, uep_t ep, void *buffer, rt_size_t size); static rt_size_t rt_usbd_ep_read_prepare(udevice_t device, uep_t ep, void *buffer, rt_size_t size); static rt_err_t rt_usbd_ep_assign(udevice_t device, uep_t ep); +rt_err_t rt_usbd_ep_unassign(udevice_t device, uep_t ep); /** * This function will handle get_device_descriptor bRequest. @@ -1864,6 +1865,19 @@ static rt_err_t rt_usbd_ep_assign(udevice_t device, uep_t ep) return -RT_ERROR; } +rt_err_t rt_usbd_ep_unassign(udevice_t device, uep_t ep) +{ + RT_ASSERT(device != RT_NULL); + RT_ASSERT(device->dcd != RT_NULL); + RT_ASSERT(device->dcd->ep_pool != RT_NULL); + RT_ASSERT(ep != RT_NULL); + RT_ASSERT(ep->ep_desc != RT_NULL); + + ep->id->status = ID_UNASSIGNED; + + return RT_EOK; +} + rt_err_t rt_usbd_ep0_setup_handler(udcd_t dcd, struct urequest* setup) { struct udev_msg msg; |
