Skip to content

Commit

Permalink
stm32: Add optional lwip loopback support.
Browse files Browse the repository at this point in the history
MICROPY_PY_LWIP_LOOPBACK must be set at the make level to enable this.

Signed-off-by: Peter Züger <zueger.peter@icloud.com>
  • Loading branch information
peterzuger authored and dpgeorge committed Nov 17, 2023
1 parent 1879db7 commit a23dbdc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ports/stm32/lwip_inc/lwipopts.h
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions ports/stm32/mpnetworkport.c
Expand Up @@ -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) {
Expand Down

0 comments on commit a23dbdc

Please sign in to comment.