Skip to content

Commit d3c08af

Browse files
committed
1. 保留目前未用到的rt_usbd_ep_unassign函数,暂时移除static属性,消除警告.
2. 修改一处存在多余括号问题. armclang有警告发出.
1 parent 923d6fe commit d3c08af

File tree

2 files changed

+15
-1
lines changed
  • components/drivers/usb

2 files changed

+15
-1
lines changed

components/drivers/usb/usbdevice/core/core.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ static rt_list_t device_list;
3636
static rt_size_t rt_usbd_ep_write(udevice_t device, uep_t ep, void *buffer, rt_size_t size);
3737
static rt_size_t rt_usbd_ep_read_prepare(udevice_t device, uep_t ep, void *buffer, rt_size_t size);
3838
static rt_err_t rt_usbd_ep_assign(udevice_t device, uep_t ep);
39+
rt_err_t rt_usbd_ep_unassign(udevice_t device, uep_t ep);
3940

4041
/**
4142
* 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)
18641865
return -RT_ERROR;
18651866
}
18661867

1868+
rt_err_t rt_usbd_ep_unassign(udevice_t device, uep_t ep)
1869+
{
1870+
RT_ASSERT(device != RT_NULL);
1871+
RT_ASSERT(device->dcd != RT_NULL);
1872+
RT_ASSERT(device->dcd->ep_pool != RT_NULL);
1873+
RT_ASSERT(ep != RT_NULL);
1874+
RT_ASSERT(ep->ep_desc != RT_NULL);
1875+
1876+
ep->id->status = ID_UNASSIGNED;
1877+
1878+
return RT_EOK;
1879+
}
1880+
18671881
rt_err_t rt_usbd_ep0_setup_handler(udcd_t dcd, struct urequest* setup)
18681882
{
18691883
struct udev_msg msg;

components/drivers/usb/usbhost/core/hub.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ static rt_err_t rt_usbh_hub_port_change(uhub_t hub)
413413
RT_DEBUG_LOG(RT_DEBUG_USB, ("port %d status 0x%x\n", i + 1, pstatus));
414414

415415
/* check port status change */
416-
if ((pstatus & PORT_CCSC))
416+
if (pstatus & PORT_CCSC)
417417
{
418418
/* clear port status change feature */
419419
rt_usbh_hub_clear_port_feature(hub, i + 1, PORT_FEAT_C_CONNECTION);

0 commit comments

Comments
 (0)