diff --git a/components/esp_eth/src/mac/esp_eth_mac_esp.c b/components/esp_eth/src/mac/esp_eth_mac_esp.c index f0813bb7ca..061b8988d4 100644 --- a/components/esp_eth/src/mac/esp_eth_mac_esp.c +++ b/components/esp_eth/src/mac/esp_eth_mac_esp.c @@ -574,8 +574,8 @@ static esp_err_t emac_esp_alloc_driver_obj(const eth_mac_config_t *config, emac_ config->rx_task_prio, &emac->rx_task_hdl, core_num); ESP_GOTO_ON_FALSE(xReturned == pdPASS, ESP_FAIL, err, TAG, "create emac_rx task failed"); - *emac_out_hdl = emac; err: + *emac_out_hdl = emac; return ret; } diff --git a/components/esp_eth/src/mac/esp_eth_mac_esp_gpio.c b/components/esp_eth/src/mac/esp_eth_mac_esp_gpio.c index cb9ea5c1a2..3117832b29 100644 --- a/components/esp_eth/src/mac/esp_eth_mac_esp_gpio.c +++ b/components/esp_eth/src/mac/esp_eth_mac_esp_gpio.c @@ -28,7 +28,7 @@ static uint64_t s_emac_esp_used_gpio_mask = 0x0; static esp_err_t emac_esp_gpio_matrix_init(gpio_num_t gpio_num, uint32_t signal_in_idx, uint32_t signal_out_idx, gpio_mode_t mode) { // silently skip when user don't want to connect the signal to GPIO pad - if (gpio_num == GPIO_NUM_NC) { + if (gpio_num <= GPIO_NUM_NC) { ESP_LOGD(TAG, "%s skipping signal in_idx %" PRIu32 ", out_idx %" PRIu32, __func__, signal_in_idx, signal_out_idx); return ESP_OK; } @@ -74,6 +74,11 @@ static esp_err_t emac_esp_iomux_init(gpio_num_t gpio_num, const emac_iomux_info_ ESP_LOGD(TAG, "%s skipping target undefined iomux periph function", __func__); return ESP_OK; } + // silently skip when user don't want to iomux the function to GPIO pad + if (gpio_num <= GPIO_NUM_NC) { + ESP_LOGD(TAG, "%s user defined GPIO not connected - skipping", __func__); + return ESP_OK; + } // loop over target iomux_info until reached end of list indicated by invalid GPIO num while (iomux_info->gpio_num != GPIO_NUM_MAX) { // if requested GPIO number can be IO muxed or select single pad that can be muxed on the target