georgerobotics / cyw43-driver

Other
79 stars 42 forks source link

Compilation fails if LWIP_SINGLE_NETIF is set #124

Open peterharperuk opened 1 month ago

peterharperuk commented 1 month ago

If LWIP_SINGLE_NETIF is set netif_list is not defined. So you get a build error in the lwip code. Fix is simple enough.

diff --git a/src/cyw43_lwip.c b/src/cyw43_lwip.c
index be043f4..67d62b2 100644
--- a/src/cyw43_lwip.c
+++ b/src/cyw43_lwip.c
@@ -251,7 +251,8 @@ void cyw43_cb_tcpip_deinit(cyw43_t *self, int itf) {
         dhcp_server_deinit(&self->dhcp_server);
         #endif
     }
-    for (struct netif *netif = netif_list; netif != NULL; netif = netif->next) {
+    struct netif *netif;
+    NETIF_FOREACH(netif) {
         if (netif == n) {
             netif_remove(netif);
             #if LWIP_IPV4
dpgeorge commented 4 weeks ago

Thanks for the report and fix. See #125.