/* USB_OTG_ReadPacket : Reads a packet from the Rx FIFO.  */
void* USB_OTG_ReadPacket(USB_OTG_CORE_HANDLE *pdev, uint8_t *dest, uint16_t len)
/* USB_OTG_ReadPacket : Reads a packet from the Rx FIFO.  */
void* USB_OTG_ReadPacket(USB_OTG_CORE_HANDLE *pdev, uint8_t *dest, uint16_t len)
{
  uint32_t i=0;
  uint32_t count32b = (len + 3) / 4;
  __IO uint32_t *fifo = pdev->regs.DFIFO[0];
  for ( i = 0; i < count32b; i++, dest += 4 )
  {
    *(__packed uint32_t *)dest = USB_OTG_READ_REG32(fifo);
  }
  return ((void *)dest);
}