Fixed Ethernet lwIP netif error indication

This commit is contained in:
Ondrej Kosta 2022-01-11 16:40:39 +01:00 committed by BOT
parent f5ee7093b8
commit ba62cbc04f
2 changed files with 5 additions and 4 deletions

View File

@ -226,7 +226,7 @@ static esp_err_t emac_esp32_transmit(esp_eth_mac_t *mac, uint8_t *buf, uint32_t
esp_err_t ret = ESP_OK;
emac_esp32_t *emac = __containerof(mac, emac_esp32_t, parent);
uint32_t sent_len = emac_hal_transmit_frame(&emac->hal, buf, length);
ESP_GOTO_ON_FALSE(sent_len == length, ESP_ERR_INVALID_SIZE, err, TAG, "insufficient TX buffer size");
ESP_GOTO_ON_FALSE(sent_len == length, ESP_ERR_NO_MEM, err, TAG, "insufficient TX buffer size");
return ESP_OK;
err:
return ret;

View File

@ -134,11 +134,12 @@ static err_t ethernet_low_level_output(struct netif *netif, struct pbuf *p)
pbuf_free(q);
}
/* Check error */
if (unlikely(ret != ESP_OK)) {
return ERR_ABRT;
} else {
if (likely(ret == ESP_OK)) {
return ERR_OK;
} else if (ret == ESP_ERR_NO_MEM) {
return ERR_MEM;
}
return ERR_IF;
}
/**