From d46dcaf9e50dee46df03769903079bb8191dac63 Mon Sep 17 00:00:00 2001 From: shangke Date: Wed, 15 Nov 2017 11:04:32 +0800 Subject: [PATCH] component/emac: fix process rx err --- components/ethernet/emac_main.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/components/ethernet/emac_main.c b/components/ethernet/emac_main.c index 044c0337bd..c58c131540 100644 --- a/components/ethernet/emac_main.c +++ b/components/ethernet/emac_main.c @@ -481,6 +481,10 @@ static void emac_process_rx_unavail(void) while (emac_config.cnt_rx < DMA_RX_BUF_NUM) { + if (emac_config.dma_erx[emac_config.dirty_rx].basic.desc0 == EMAC_DESC_RX_OWN) { + break; + } + emac_config.cnt_rx++; if (emac_config.cnt_rx > DMA_RX_BUF_NUM) { ESP_LOGE(TAG, "emac rx unavail buf err !!\n"); @@ -530,6 +534,10 @@ static void emac_process_rx(void) if ((emac_config.dma_erx[emac_config.dirty_rx].basic.desc0 & EMAC_DESC_RX_OWN) == 0) { while (emac_config.cnt_rx < DMA_RX_BUF_NUM) { + if (emac_config.dma_erx[emac_config.dirty_rx].basic.desc0 == EMAC_DESC_RX_OWN) { + break; + } + emac_config.cnt_rx++; if (emac_config.cnt_rx > DMA_RX_BUF_NUM) { ESP_LOGE(TAG, "emac rx buf err!!!\n"); -- 2.40.0