Skip to content

Commit d99c1e1

Browse files
committed
Add Support for ESP-IDF v5.5
Co-authored-by: @YanKE01
1 parent 7e79086 commit d99c1e1

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
fail-fast: false
2525
matrix:
2626
idf_target: [esp32, esp32s2, esp32s3, esp32c3, esp32c6]
27-
idf_version: [v5.2, v5.3, v5.4]
27+
idf_version: [v5.2, v5.3, v5.4, v5.5]
2828

2929
container:
3030
image: 'espressif/idf:release-${{ matrix.idf_version }}'

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
# micro-ROS component for ESP-IDF
55

6-
This component has been tested in ESP-IDF v5.2, v5.3, and v5.4 with ESP32, ESP32-S2, ESP32-S3, ESP32-C3 and ESP32-C6.
6+
This component has been tested in ESP-IDF v5.2, v5.3, v5.4, and v5.5 with ESP32, ESP32-S2, ESP32-S3, ESP32-C3 and ESP32-C6.
77

88
## Dependencies
99

network_interfaces/uros_ethernet_netif.c

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,20 +74,31 @@ esp_err_t uros_network_interface_initialize(void)
7474
ESP_ERROR_CHECK(esp_event_loop_create_default());
7575
esp_netif_config_t cfg = ESP_NETIF_DEFAULT_ETH();
7676
esp_netif_t *eth_netif = esp_netif_new(&cfg);
77-
// Set default handlers to process TCP/IP stuffs
77+
// Set default handlers to process TCP/IP stuffs (removed in ESP-IDF 5.5+)
78+
#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 5, 0)
7879
ESP_ERROR_CHECK(esp_eth_set_default_handlers(eth_netif));
80+
#endif
7981
// Register user defined event handers
8082
ESP_ERROR_CHECK(esp_event_handler_register(ETH_EVENT, ESP_EVENT_ANY_ID, &eth_event_handler, NULL));
8183
ESP_ERROR_CHECK(esp_event_handler_register(IP_EVENT, IP_EVENT_ETH_GOT_IP, &got_ip_event_handler, NULL));
8284

8385
eth_mac_config_t mac_config = ETH_MAC_DEFAULT_CONFIG();
86+
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 5, 0)
87+
eth_esp32_emac_config_t esp32_emac_config = ETH_ESP32_EMAC_DEFAULT_CONFIG();
88+
#endif
8489
eth_phy_config_t phy_config = ETH_PHY_DEFAULT_CONFIG();
8590
phy_config.phy_addr = CONFIG_MICRO_ROS_ETH_PHY_ADDR;
8691
phy_config.reset_gpio_num = CONFIG_MICRO_ROS_ETH_PHY_RST_GPIO;
8792
#if CONFIG_MICRO_ROS_USE_INTERNAL_ETHERNET
93+
#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 5, 0)
8894
mac_config.smi_mdc_gpio_num = CONFIG_MICRO_ROS_ETH_MDC_GPIO;
8995
mac_config.smi_mdio_gpio_num = CONFIG_MICRO_ROS_ETH_MDIO_GPIO;
9096
esp_eth_mac_t *mac = esp_eth_mac_new_esp32(&mac_config);
97+
#else
98+
esp32_emac_config.smi_gpio.mdc_num = CONFIG_MICRO_ROS_ETH_MDC_GPIO;
99+
esp32_emac_config.smi_gpio.mdio_num = CONFIG_MICRO_ROS_ETH_MDIO_GPIO;
100+
esp_eth_mac_t *mac = esp_eth_mac_new_esp32(&esp32_emac_config, &mac_config);
101+
#endif
91102
#if CONFIG_MICRO_ROS_ETH_PHY_IP101
92103
esp_eth_phy_t *phy = esp_eth_phy_new_ip101(&phy_config);
93104
#elif CONFIG_MICRO_ROS_ETH_PHY_RTL8201
@@ -161,4 +172,4 @@ esp_err_t uros_network_interface_initialize(void)
161172
return ESP_OK;
162173
}
163174

164-
#endif
175+
#endif

0 commit comments

Comments
 (0)