Skip to content

Commit

Permalink
Merge pull request espressif#476 from david-cermak/fix/ci_examples
Browse files Browse the repository at this point in the history
fix(examples): Fixed esp_netif_next() warning with IDFv5.3
  • Loading branch information
david-cermak authored Jan 8, 2024
2 parents 9df8664 + 52a34c2 commit 18b2ae1
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2019-2022 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2019-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand Down Expand Up @@ -109,7 +109,11 @@ static esp_netif_t *get_netif_with_esp_index(int index)
{
esp_netif_t *netif = NULL;
int counter = 0;
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 2, 0)
while ((netif = esp_netif_next_unsafe(netif)) != NULL) {
#else
while ((netif = esp_netif_next(netif)) != NULL) {
#endif
if (counter == index) {
return netif;
}
Expand All @@ -124,7 +128,11 @@ static int get_esp_netif_index(esp_netif_t *esp_netif)
{
esp_netif_t *netif = NULL;
int counter = 0;
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 2, 0)
while ((netif = esp_netif_next_unsafe(netif)) != NULL) {
#else
while ((netif = esp_netif_next(netif)) != NULL) {
#endif
if (esp_netif == netif) {
return counter;
}
Expand Down

0 comments on commit 18b2ae1

Please sign in to comment.