File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ static rt_list_t device_list;
3636static rt_size_t rt_usbd_ep_write (udevice_t device , uep_t ep , void * buffer , rt_size_t size );
3737static rt_size_t rt_usbd_ep_read_prepare (udevice_t device , uep_t ep , void * buffer , rt_size_t size );
3838static 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+
18671881rt_err_t rt_usbd_ep0_setup_handler (udcd_t dcd , struct urequest * setup )
18681882{
18691883 struct udev_msg msg ;
Original file line number Diff line number Diff 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 );
You can’t perform that action at this time.
0 commit comments