From 8fdb2df0bf4ff6759e1b1ca5c8511f2531ece1f2 Mon Sep 17 00:00:00 2001 From: paul-1 <6473457+paul-1@users.noreply.github.com> Date: Sat, 29 Oct 2022 10:22:58 -0400 Subject: [PATCH] picow: enable dhcpserver for apmode. --- ports/raspberrypi/Makefile | 4 +++- shared/netutils/dhcpserver.c | 2 +- shared/netutils/netutils.h | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ports/raspberrypi/Makefile b/ports/raspberrypi/Makefile index 5095c4c1f8..d7373642b3 100644 --- a/ports/raspberrypi/Makefile +++ b/ports/raspberrypi/Makefile @@ -65,7 +65,7 @@ INC_CYW43 := \ -isystem sdk/src/rp2_common/pico_cyw43_arch/include/ \ -isystem sdk/src/rp2_common/pico_lwip/include/ \ -CFLAGS_CYW43 := -DCYW43_LWIP=1 -DPICO_CYW43_ARCH_THREADSAFE_BACKGROUND=1 -DCYW43_USE_SPI -DIGNORE_GPIO25 -DIGNORE_GPIO23 -DIGNORE_GPIO24 -DCYW43_LOGIC_DEBUG=0 +CFLAGS_CYW43 := -DCYW43_LWIP=1 -DPICO_CYW43_ARCH_THREADSAFE_BACKGROUND=1 -DCYW43_USE_SPI -DIGNORE_GPIO25 -DIGNORE_GPIO23 -DIGNORE_GPIO24 -DCYW43_LOGIC_DEBUG=0 -DCYW43_NETUTILS=1 SRC_SDK_CYW43 := \ src/common/pico_sync/sem.c \ src/rp2_common/cyw43_driver/cyw43_bus_pio_spi.c \ @@ -76,6 +76,8 @@ SRC_SDK_CYW43 := \ SRC_LWIP := \ shared/netutils/netutils.c \ + shared/netutils/trace.c \ + shared/netutils/dhcpserver.c \ $(wildcard lib/lwip/src/core/*.c) \ $(wildcard lib/lwip/src/core/ipv4/*.c) \ lib/lwip/src/netif/ethernet.c \ diff --git a/shared/netutils/dhcpserver.c b/shared/netutils/dhcpserver.c index 9db42b3fd9..a61501c93c 100644 --- a/shared/netutils/dhcpserver.c +++ b/shared/netutils/dhcpserver.c @@ -33,7 +33,7 @@ #include "py/mperrno.h" #include "py/mphal.h" -#if MICROPY_PY_LWIP +#if LWIP_UDP #include "shared/netutils/dhcpserver.h" #include "lwip/udp.h" diff --git a/shared/netutils/netutils.h b/shared/netutils/netutils.h index b23a78e5b8..3bb9212800 100644 --- a/shared/netutils/netutils.h +++ b/shared/netutils/netutils.h @@ -33,6 +33,8 @@ #define NETUTILS_TRACE_PAYLOAD (0x0002) #define NETUTILS_TRACE_NEWLINE (0x0004) +#include "py/runtime.h" + typedef enum _netutils_endian_t { NETUTILS_LITTLE, NETUTILS_BIG,