/* write data from user FIFO to USB RAM  */
static void usbd_ep_data_write(uint8_t *user_fifo, uint8_t ep_num, uint16_t bytes)
/* write data from user FIFO to USB RAM  */
static void usbd_ep_data_write(uint8_t *user_fifo, uint8_t ep_num, uint16_t bytes)
{
    if (0U != bytes) {
        uint32_t n;
        uint32_t *write_addr = (uint32_t *)(btable_ep[ep_num].tx_addr * 2U + USBD_RAM);
        for (n = 0U; n < (bytes + 1U) / 2U; n++) {
            *write_addr++ = *((uint16_t*)user_fifo);
            user_fifo += 2U;
        }
    }
    btable_ep[ep_num].tx_count = bytes;
    USBD_EP_TX_STAT_SET(ep_num, EPTX_VALID);
}