/* USBH_GetFreeChannel Get a free channel number for allocation to a device endpoint.  */
static uint16_t USBH_GetFreeChannel(USB_OTG_CORE_HANDLE *pdev)
/* USBH_GetFreeChannel Get a free channel number for allocation to a device endpoint.  */
static uint16_t USBH_GetFreeChannel(USB_OTG_CORE_HANDLE *pdev)
{
  uint8_t idx = 0;
  for (idx = 0 ; idx < HC_MAX ; idx++)
  {
	if ((pdev->host.channel[idx] & HC_USED) == 0)
	{
	   return idx;
	} 
  }
  return HC_ERROR;
}