Skip to content

Commit 18b2ae1

Browse files
authored
Merge pull request #476 from david-cermak/fix/ci_examples
fix(examples): Fixed esp_netif_next() warning with IDFv5.3
2 parents 9df8664 + 52a34c2 commit 18b2ae1

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

examples/esp_netif/slip_custom_netif/components/slip_modem/library/slip_modem_netif.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: 2019-2022 Espressif Systems (Shanghai) CO LTD
2+
* SPDX-FileCopyrightText: 2019-2024 Espressif Systems (Shanghai) CO LTD
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
@@ -109,7 +109,11 @@ static esp_netif_t *get_netif_with_esp_index(int index)
109109
{
110110
esp_netif_t *netif = NULL;
111111
int counter = 0;
112+
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 2, 0)
113+
while ((netif = esp_netif_next_unsafe(netif)) != NULL) {
114+
#else
112115
while ((netif = esp_netif_next(netif)) != NULL) {
116+
#endif
113117
if (counter == index) {
114118
return netif;
115119
}
@@ -124,7 +128,11 @@ static int get_esp_netif_index(esp_netif_t *esp_netif)
124128
{
125129
esp_netif_t *netif = NULL;
126130
int counter = 0;
131+
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 2, 0)
132+
while ((netif = esp_netif_next_unsafe(netif)) != NULL) {
133+
#else
127134
while ((netif = esp_netif_next(netif)) != NULL) {
135+
#endif
128136
if (esp_netif == netif) {
129137
return counter;
130138
}

0 commit comments

Comments
 (0)