/* Disable endpoint for transferring data. 
This function cancels transfers that are associated with endpoint and disabled endpoint itself. */
static bool reset_endpoint(const struct usb_ep_descriptor *ep_desc)
/* Disable endpoint for transferring data. 
This function cancels transfers that are associated with endpoint and disabled endpoint itself. */
static bool reset_endpoint(const struct usb_ep_descriptor *ep_desc)
{
	struct usb_dc_ep_cfg_data ep_cfg;
	ep_cfg.ep_addr = ep_desc->bEndpointAddress;
	ep_cfg.ep_type = ep_desc->bmAttributes & USB_EP_TRANSFER_TYPE_MASK;
	LOG_DBG("Reset endpoint 0x%02x type %u",
		ep_cfg.ep_addr, ep_cfg.ep_type);
	usb_cancel_transfer(ep_cfg.ep_addr);
	return disable_endpoint(ep_cfg.ep_addr) ? false : true;
}