/* flush the ENET transmit FIFO, and wait until the flush operation completes  */
ErrStatus enet_txfifo_flush(void)
/* flush the ENET transmit FIFO, and wait until the flush operation completes  */
ErrStatus enet_txfifo_flush(void)
{
    uint32_t flush_state;
    uint32_t timeout = 0U;
    ErrStatus enet_state = ERROR;
    ENET_DMA_CTL |= ENET_DMA_CTL_FTF;
    do {
        flush_state = ENET_DMA_CTL & ENET_DMA_CTL_FTF;
        timeout++;
    } while((RESET != flush_state) && (timeout < ENET_DELAY_TO));
    if(RESET == flush_state) {
        enet_state = SUCCESS;
    }
    return  enet_state;
}