/* This function will create an usb endpoint object. */
uep_t rt_usbd_endpoint_new(uep_desc_t ep_desc, udep_handler_t handler)
/* This function will create an usb endpoint object. */
uep_t rt_usbd_endpoint_new(uep_desc_t ep_desc, udep_handler_t handler)
{
    uep_t ep;
    LOG_D("rt_usbd_endpoint_new");
    RT_ASSERT(ep_desc != RT_NULL);
    ep = (uep_t)rt_malloc(sizeof(struct uendpoint));
    if(ep == RT_NULL)
    {
        rt_kprintf("alloc memory failed\n");
        return RT_NULL;
    }
    ep->ep_desc = ep_desc;
    ep->handler = handler;
    ep->buffer  = RT_NULL;
    ep->stalled = RT_FALSE;
    rt_list_init(&ep->request_list);
    return ep;
}