mirror of
https://github.com/espressif/esp-protocols.git
synced 2025-07-22 23:07:28 +02:00
ethernet: work with cache disabled
add ETH_MAC_FLAG_WORK_WITH_CACHE_DISABLE flag, make ethenret driver possible to work when cache disabled Closes https://github.com/espressif/esp-idf/issues/4406 * Original commit: espressif/esp-idf@5ad0bdd8db
This commit is contained in:
committed by
suren-gabrielyan-espressif
parent
b5e5a64e7f
commit
74aee42f80
@ -208,6 +208,7 @@ static void on_eth_event(void *esp_netif, esp_event_base_t event_base,
|
||||
static esp_eth_handle_t s_eth_handle = NULL;
|
||||
static esp_eth_mac_t *s_mac = NULL;
|
||||
static esp_eth_phy_t *s_phy = NULL;
|
||||
static void *s_eth_glue = NULL;
|
||||
|
||||
static void start(void)
|
||||
{
|
||||
@ -275,7 +276,8 @@ static void start(void)
|
||||
esp_eth_config_t config = ETH_DEFAULT_CONFIG(s_mac, s_phy);
|
||||
ESP_ERROR_CHECK(esp_eth_driver_install(&config, &s_eth_handle));
|
||||
// combine driver with netif
|
||||
esp_netif_attach(netif, esp_eth_new_netif_glue(s_eth_handle));
|
||||
s_eth_glue = esp_eth_new_netif_glue(s_eth_handle);
|
||||
esp_netif_attach(netif, s_eth_glue);
|
||||
esp_eth_start(s_eth_handle);
|
||||
s_connection_name = "Ethernet";
|
||||
}
|
||||
@ -288,11 +290,12 @@ static void stop(void)
|
||||
ESP_ERROR_CHECK(esp_event_handler_unregister(ETH_EVENT, ETHERNET_EVENT_CONNECTED, &on_eth_event));
|
||||
#endif
|
||||
ESP_ERROR_CHECK(esp_eth_stop(s_eth_handle));
|
||||
ESP_ERROR_CHECK(esp_eth_del_netif_glue(s_eth_glue));
|
||||
ESP_ERROR_CHECK(esp_eth_clear_default_handlers(s_example_esp_netif));
|
||||
ESP_ERROR_CHECK(esp_eth_driver_uninstall(s_eth_handle));
|
||||
ESP_ERROR_CHECK(s_phy->del(s_phy));
|
||||
ESP_ERROR_CHECK(s_mac->del(s_mac));
|
||||
|
||||
esp_eth_clear_default_handlers(s_example_esp_netif);
|
||||
esp_netif_destroy(s_example_esp_netif);
|
||||
s_example_esp_netif = NULL;
|
||||
}
|
||||
|
Reference in New Issue
Block a user