diff --git a/c/lc-plc-esp32/src/eth.c b/c/lc-plc-esp32/src/eth.c index 60bc56876af378e4e451f5fb58054c4ca7f1391f..a841cb9f660b28e1688cd207c5cfd5aa1fce9a4c 100644 --- a/c/lc-plc-esp32/src/eth.c +++ b/c/lc-plc-esp32/src/eth.c @@ -191,9 +191,12 @@ void ethFinit() // ESP_ERROR_CHECK(tcpip_adapter_set_default_eth_handlers()); ESP_ERROR_CHECK(esp_event_handler_register(ETH_EVENT, ESP_EVENT_ANY_ID, ð_event_handler, NULL)); ESP_ERROR_CHECK(esp_event_handler_register(IP_EVENT, IP_EVENT_ETH_GOT_IP, &got_ip_event_handler, NULL)); + + /* Create new default instance of esp-netif for Ethernet */ + esp_netif_config_t netif_cfg = ESP_NETIF_DEFAULT_ETH(); + esp_netif_t *eth_netif = esp_netif_new(&netif_cfg); - eth_esp32_emac_config_t emac_config; - + eth_esp32_emac_config_t emac_config = ETH_ESP32_EMAC_DEFAULT_CONFIG(); eth_mac_config_t mac_config = ETH_MAC_DEFAULT_CONFIG(); eth_phy_config_t phy_config = ETH_PHY_DEFAULT_CONFIG(); phy_config.phy_addr = CONFIG_EXAMPLE_ETH_PHY_ADDR; @@ -211,5 +214,7 @@ void ethFinit() esp_eth_config_t config = ETH_DEFAULT_CONFIG(mac, phy); esp_eth_handle_t eth_handle = NULL; ESP_ERROR_CHECK(esp_eth_driver_install(&config, ð_handle)); + /* attach Ethernet driver to TCP/IP stack */ + ESP_ERROR_CHECK(esp_netif_attach(eth_netif, esp_eth_new_netif_glue(eth_handle))); ESP_ERROR_CHECK(esp_eth_start(eth_handle)); } \ No newline at end of file diff --git a/qody b/qody new file mode 160000 index 0000000000000000000000000000000000000000..76331f024b440a790475647cc37a3bf1248d914b --- /dev/null +++ b/qody @@ -0,0 +1 @@ +Subproject commit 76331f024b440a790475647cc37a3bf1248d914b