summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Züger <zueger.peter@icloud.com>2023-11-03 11:18:05 +0100
committerDamien George <damien@micropython.org>2023-11-17 13:37:04 +1100
commita23dbdca7944e03a990f04f5aede0c1fb93d6919 (patch)
tree194f08d04fb28520cb0cd23f2a33758caffd510d
parent1879db7105e5139160d79193fc95964662792401 (diff)
stm32: Add optional lwip loopback support.
MICROPY_PY_LWIP_LOOPBACK must be set at the make level to enable this. Signed-off-by: Peter Züger <zueger.peter@icloud.com>
-rw-r--r--ports/stm32/lwip_inc/lwipopts.h3
-rw-r--r--ports/stm32/mpnetworkport.c4
2 files changed, 7 insertions, 0 deletions
diff --git a/ports/stm32/lwip_inc/lwipopts.h b/ports/stm32/lwip_inc/lwipopts.h
index 7b2460fa8..f641cf515 100644
--- a/ports/stm32/lwip_inc/lwipopts.h
+++ b/ports/stm32/lwip_inc/lwipopts.h
@@ -24,6 +24,9 @@
#define LWIP_NETIF_HOSTNAME 1
#define LWIP_NETIF_EXT_STATUS_CALLBACK 1
+#define LWIP_LOOPIF_MULTICAST 1
+#define LWIP_LOOPBACK_MAX_PBUFS 8
+
#define LWIP_IPV6 0
#define LWIP_DHCP 1
#define LWIP_DHCP_CHECK_LINK_UP 1
diff --git a/ports/stm32/mpnetworkport.c b/ports/stm32/mpnetworkport.c
index 62f780a35..3b9591213 100644
--- a/ports/stm32/mpnetworkport.c
+++ b/ports/stm32/mpnetworkport.c
@@ -72,6 +72,10 @@ STATIC void pyb_lwip_poll(void) {
// Run the lwIP internal updates
sys_check_timeouts();
+
+ #if LWIP_NETIF_LOOPBACK
+ netif_poll_all();
+ #endif
}
void mod_network_lwip_poll_wrapper(uint32_t ticks_ms) {