Hopi-pico/lwiopts.h

65 lines
1.7 KiB
C

#ifndef LWIPOPTS_H
#define LWIPOPTS_H
#include <stdint.h>
// Minimal lwIP configuration for Pico W (CYW43) with DHCP.
// This is intentionally small: we only need basic IPv4 + DHCP to get an address.
// No RTOS
#define NO_SYS 1
// Memory options
#define MEM_LIBC_MALLOC 0
#define MEM_ALIGNMENT 4
#define MEM_SIZE (16 * 1024)
// Pbuf options
#define PBUF_POOL_SIZE 24
#define PBUF_POOL_BUFSIZE 1700
// Link layer
#define LWIP_ARP 1
#define LWIP_ETHERNET 1
// IP options
#define LWIP_IPV4 1
#define LWIP_IPV6 0
#define IP_REASSEMBLY 0
#define IP_FRAG 0
// DHCP (client)
#define LWIP_DHCP 1
// Increase timeout slots (DHCP + DNS + TCP + MQTT can consume several; retries can amplify this).
#define MEMP_NUM_SYS_TIMEOUT 24
// Optional helpers (kept off unless needed)
#define LWIP_DNS 1
#define LWIP_UDP 1
#define LWIP_TCP 1
// MQTT needs an output ring buffer large enough for topic+payload.
// Default (256) is too small for our JSON payload and results in ERR_MEM (-1).
#define MQTT_OUTPUT_RINGBUF_SIZE 1024
// Sockets / netconn APIs not used
#define LWIP_SOCKET 0
#define LWIP_NETCONN 0
// Checksums
#define CHECKSUM_GEN_IP 1
#define CHECKSUM_GEN_UDP 1
#define CHECKSUM_GEN_TCP 1
#define CHECKSUM_CHECK_IP 1
#define CHECKSUM_CHECK_UDP 1
#define CHECKSUM_CHECK_TCP 1
// Stats disabled
#define LWIP_STATS 0
// Debug disabled
#define LWIP_DEBUG 0
#endif // LWIPOPTS_H