fix(esp_eth): Fixed Ethernet link reset when Ethernet is stopped
This commit is contained in:
@@ -181,10 +181,12 @@ static esp_err_t emac_esp32_set_link(esp_eth_mac_t *mac, eth_link_t link)
|
||||
case ETH_LINK_UP:
|
||||
ESP_GOTO_ON_ERROR(esp_intr_enable(emac->intr_hdl), err, TAG, "enable interrupt failed");
|
||||
emac_esp32_start(mac);
|
||||
ESP_LOGD(TAG, "emac started");
|
||||
break;
|
||||
case ETH_LINK_DOWN:
|
||||
ESP_GOTO_ON_ERROR(esp_intr_disable(emac->intr_hdl), err, TAG, "disable interrupt failed");
|
||||
emac_esp32_stop(mac);
|
||||
ESP_LOGD(TAG, "emac stopped");
|
||||
break;
|
||||
default:
|
||||
ESP_GOTO_ON_FALSE(false, ESP_ERR_INVALID_ARG, err, TAG, "unknown link status");
|
||||
|
||||
Reference in New Issue
Block a user