From 10758c62e6b41d68a642692596ffe17a4da3d040 Mon Sep 17 00:00:00 2001 From: graham sanderson Date: Tue, 3 Sep 2024 17:26:07 -0500 Subject: [PATCH] Revert "Fix compile issues with LWIP_SINGLE_NETIF (#515)" This reverts commit 2507272357d814c938b1d7ead17ef6f250e7d67b. --- pico_w/bt/picow_bt_example_common.c | 2 +- pico_w/bt/standalone/server_with_wifi.c | 2 +- pico_w/wifi/freertos/httpd/pico_freertos_httpd.c | 2 +- pico_w/wifi/freertos/iperf/picow_freertos_iperf.c | 2 +- pico_w/wifi/httpd/pico_httpd.c | 2 +- pico_w/wifi/iperf/picow_iperf.c | 2 +- pico_w/wifi/lwipopts_examples_common.h | 1 - pico_w/wifi/tcp_server/picow_tcp_server.c | 2 +- 8 files changed, 7 insertions(+), 8 deletions(-) diff --git a/pico_w/bt/picow_bt_example_common.c b/pico_w/bt/picow_bt_example_common.c index cd20ceec4..7d93520b1 100644 --- a/pico_w/bt/picow_bt_example_common.c +++ b/pico_w/bt/picow_bt_example_common.c @@ -97,7 +97,7 @@ void picow_bt_example_main(void) { } else { printf("Connected in %lus.\n", (to_ms_since_boot(get_absolute_time()) - start_ms) / 1000); } - printf("\nReady, running iperf server at %s\n", ip4addr_ntoa(netif_ip4_addr(netif_default))); + printf("\nReady, running iperf server at %s\n", ip4addr_ntoa(netif_ip4_addr(netif_list))); lwiperf_start_tcp_server_default(&iperf_report, NULL); #endif } diff --git a/pico_w/bt/standalone/server_with_wifi.c b/pico_w/bt/standalone/server_with_wifi.c index 014051068..af17e6f05 100644 --- a/pico_w/bt/standalone/server_with_wifi.c +++ b/pico_w/bt/standalone/server_with_wifi.c @@ -100,7 +100,7 @@ int main() { // setup iperf cyw43_arch_lwip_begin(); - printf("\nReady, running iperf server at %s\n", ip4addr_ntoa(netif_ip4_addr(netif_default))); + printf("\nReady, running iperf server at %s\n", ip4addr_ntoa(netif_ip4_addr(netif_list))); lwiperf_start_tcp_server_default(&iperf_report, NULL); cyw43_arch_lwip_end(); diff --git a/pico_w/wifi/freertos/httpd/pico_freertos_httpd.c b/pico_w/wifi/freertos/httpd/pico_freertos_httpd.c index 207be5d7f..0a262e5de 100644 --- a/pico_w/wifi/freertos/httpd/pico_freertos_httpd.c +++ b/pico_w/wifi/freertos/httpd/pico_freertos_httpd.c @@ -158,7 +158,7 @@ void main_task(__unused void *params) { #endif #endif - printf("\nReady, running httpd at %s\n", ip4addr_ntoa(netif_ip4_addr(netif_default))); + printf("\nReady, running httpd at %s\n", ip4addr_ntoa(netif_ip4_addr(netif_list))); httpd_init(); http_set_cgi_handlers(cgi_handlers, LWIP_ARRAYSIZE(cgi_handlers)); diff --git a/pico_w/wifi/freertos/iperf/picow_freertos_iperf.c b/pico_w/wifi/freertos/iperf/picow_freertos_iperf.c index 1e8fb6489..148f6035a 100644 --- a/pico_w/wifi/freertos/iperf/picow_freertos_iperf.c +++ b/pico_w/wifi/freertos/iperf/picow_freertos_iperf.c @@ -79,7 +79,7 @@ void main_task(__unused void *params) { ip4_addr_set_u32(&clientaddr, ipaddr_addr(xstr(IPERF_SERVER_IP))); assert(lwiperf_start_tcp_client_default(&clientaddr, &iperf_report, NULL) != NULL); #else - printf("\nReady, running iperf server at %s\n", ip4addr_ntoa(netif_ip4_addr(netif_default))); + printf("\nReady, running iperf server at %s\n", ip4addr_ntoa(netif_ip4_addr(netif_list))); lwiperf_start_tcp_server_default(&iperf_report, NULL); #endif cyw43_arch_lwip_end(); diff --git a/pico_w/wifi/httpd/pico_httpd.c b/pico_w/wifi/httpd/pico_httpd.c index 87e9f85e9..e469c88f0 100644 --- a/pico_w/wifi/httpd/pico_httpd.c +++ b/pico_w/wifi/httpd/pico_httpd.c @@ -203,7 +203,7 @@ int main() { } else { printf("Connected.\n"); } - printf("\nReady, running httpd at %s\n", ip4addr_ntoa(netif_ip4_addr(netif_default))); + printf("\nReady, running httpd at %s\n", ip4addr_ntoa(netif_ip4_addr(netif_list))); // start http server wifi_connected_time = get_absolute_time(); diff --git a/pico_w/wifi/iperf/picow_iperf.c b/pico_w/wifi/iperf/picow_iperf.c index e676591c9..927e5c7b2 100644 --- a/pico_w/wifi/iperf/picow_iperf.c +++ b/pico_w/wifi/iperf/picow_iperf.c @@ -72,7 +72,7 @@ int main() { ip4_addr_set_u32(&clientaddr, ipaddr_addr(xstr(IPERF_SERVER_IP))); assert(lwiperf_start_tcp_client_default(&clientaddr, &iperf_report, NULL) != NULL); #else - printf("\nReady, running iperf server at %s\n", ip4addr_ntoa(netif_ip4_addr(netif_default))); + printf("\nReady, running iperf server at %s\n", ip4addr_ntoa(netif_ip4_addr(netif_list))); lwiperf_start_tcp_server_default(&iperf_report, NULL); #endif cyw43_arch_lwip_end(); diff --git a/pico_w/wifi/lwipopts_examples_common.h b/pico_w/wifi/lwipopts_examples_common.h index a857a1fe5..217cb1357 100644 --- a/pico_w/wifi/lwipopts_examples_common.h +++ b/pico_w/wifi/lwipopts_examples_common.h @@ -51,7 +51,6 @@ #define LWIP_NETIF_TX_SINGLE_PBUF 1 #define DHCP_DOES_ARP_CHECK 0 #define LWIP_DHCP_DOES_ACD_CHECK 0 -#define LWIP_SINGLE_NETIF 1 #ifndef NDEBUG #define LWIP_DEBUG 1 diff --git a/pico_w/wifi/tcp_server/picow_tcp_server.c b/pico_w/wifi/tcp_server/picow_tcp_server.c index 2d5be709e..f9b500eb4 100644 --- a/pico_w/wifi/tcp_server/picow_tcp_server.c +++ b/pico_w/wifi/tcp_server/picow_tcp_server.c @@ -187,7 +187,7 @@ static err_t tcp_server_accept(void *arg, struct tcp_pcb *client_pcb, err_t err) static bool tcp_server_open(void *arg) { TCP_SERVER_T *state = (TCP_SERVER_T*)arg; - DEBUG_printf("Starting server at %s on port %u\n", ip4addr_ntoa(netif_ip4_addr(netif_default)), TCP_PORT); + DEBUG_printf("Starting server at %s on port %u\n", ip4addr_ntoa(netif_ip4_addr(netif_list)), TCP_PORT); struct tcp_pcb *pcb = tcp_new_ip_type(IPADDR_TYPE_ANY); if (!pcb) {