/* flush a TX FIFO or all TX FIFOs  */
usb_status usb_txfifo_flush(usb_core_regs *usb_regs, uint8_t fifo_num)
/* flush a TX FIFO or all TX FIFOs  */
usb_status usb_txfifo_flush(usb_core_regs *usb_regs, uint8_t fifo_num)
{
    usb_regs->gr->GRSTCTL = ((uint32_t)fifo_num << 6U) | GRSTCTL_TXFF;
    while (usb_regs->gr->GRSTCTL & GRSTCTL_TXFF) {
    }
    usb_udelay(3U);
    return USB_OK;
}