Skip to content

Commit a23dbdc

Browse files
peterzugerdpgeorge
authored andcommitted
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>
1 parent 1879db7 commit a23dbdc

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

ports/stm32/lwip_inc/lwipopts.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
#define LWIP_NETIF_HOSTNAME 1
2525
#define LWIP_NETIF_EXT_STATUS_CALLBACK 1
2626

27+
#define LWIP_LOOPIF_MULTICAST 1
28+
#define LWIP_LOOPBACK_MAX_PBUFS 8
29+
2730
#define LWIP_IPV6 0
2831
#define LWIP_DHCP 1
2932
#define LWIP_DHCP_CHECK_LINK_UP 1

ports/stm32/mpnetworkport.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ STATIC void pyb_lwip_poll(void) {
7272

7373
// Run the lwIP internal updates
7474
sys_check_timeouts();
75+
76+
#if LWIP_NETIF_LOOPBACK
77+
netif_poll_all();
78+
#endif
7579
}
7680

7781
void mod_network_lwip_poll_wrapper(uint32_t ticks_ms) {

0 commit comments

Comments
 (0)