/* Write a buffer of data to a selected endpoint.  */
void USBD_WriteDataToEP(USBD_EP_T ep, uint8_t *wBuf, uint32_t wLen)
/* Write a buffer of data to a selected endpoint.  */
void USBD_WriteDataToEP(USBD_EP_T ep, uint8_t *wBuf, uint32_t wLen)
{
    uint32_t i;
    uint32_t *addrEP;
    uint32_t tmp;
    wLen = (wLen + 1) >> 1;
    addrEP = (uint32_t *)USBD_ReadEPTxAddr(ep);
    addrEP = (uint32_t *)(((uint32_t)addrEP << 1) + USBD_PMA_ADDR);
    for(i = 0; i < wLen; i++)
    {
        tmp = *wBuf++;
        tmp = ((*wBuf++) << 8) | tmp;
        *addrEP++ = tmp;
    }
}