|
5 | 5 | // Common settings used in most of the pico_w examples
|
6 | 6 | // (see https://www.nongnu.org/lwip/2_1_x/group__lwip__opts.html for details)
|
7 | 7 |
|
| 8 | +#include "lwip_mem.h" |
| 9 | + |
8 | 10 | // allow override in some examples
|
9 | 11 | #ifndef NO_SYS
|
10 | 12 | #define NO_SYS 1
|
|
20 | 22 | #define MEM_LIBC_MALLOC 0
|
21 | 23 | #endif
|
22 | 24 | #define MEM_ALIGNMENT 4
|
23 |
| -#define MEM_SIZE 4000 |
24 |
| -#define MEMP_NUM_TCP_SEG 32 |
25 |
| -#define MEMP_NUM_ARP_QUEUE 10 |
26 |
| -#define PBUF_POOL_SIZE 24 |
| 25 | +// MEM_USE_POOLS: mem_malloc uses pools of fixed size memory blocks. Default is 0. |
| 26 | +#define MEM_USE_POOLS 0 |
| 27 | +// MEM_USE_POOLS_TRY_BIGGER_POOL: if one pool is empty, try the next bigger pool. Default is 0. |
| 28 | +#define MEM_USE_POOLS_TRY_BIGGER_POOL 0 |
| 29 | +// MEMP_USE_CUSTOM_POOLS: Use custom pools defined in lwippools.h. Default is 0. |
| 30 | +#define MEMP_USE_CUSTOM_POOLS 0 |
| 31 | +// MEMP_MEM_MALLOC: Use mem_malloc() for pool memory. Default is 0. |
| 32 | +#define MEMP_MEM_MALLOC 1 |
| 33 | +#define MEM_CUSTOM_ALLOCATOR 1 |
| 34 | +#define MEM_CUSTOM_FREE lwip_heap_free |
| 35 | +#define MEM_CUSTOM_MALLOC lwip_heap_malloc |
| 36 | +#define MEM_CUSTOM_CALLOC lwip_heap_calloc |
| 37 | + |
| 38 | +// MEM_SIZE: The LWIP heap size. Memory for mem_malloc and mem_calloc are allocated from |
| 39 | +// this heap. If MEMP_MEM_MALLOC is set to 1, memory for memp_malloc is also allocated from |
| 40 | +// this heap; if it is 0, memory is statically pre-allocated for each pool. |
| 41 | +// Default is 1600. |
| 42 | +#define MEM_SIZE 1600 |
| 43 | +// MEMP_NUM_PBUF: memp pbufs used when sending from static memory. Default is 16. |
| 44 | +#define MEMP_NUM_PBUF 16 |
| 45 | +// MEMP_NUM_RAW_PCB: Number of raw connection PCBs. Default is 4. |
| 46 | +#define MEMP_NUM_RAW_PCB 4 |
| 47 | +// MEMP_NUM_UDP_PCB: Number of UDP PCBs. Default is 4. |
| 48 | +#define MEMP_NUM_UDP_PCB 4 |
| 49 | +// MEMP_NUM_TCP_PCB: Number of simultaneously active TCP connections. Default is 5. |
| 50 | +#define MEMP_NUM_TCP_PCB 5 |
| 51 | +// MEMP_NUM_TCP_PCB_LISTEN: Number of listening TCP PCBs. Default is 8. |
| 52 | +#define MEMP_NUM_TCP_PCB_LISTEN 8 |
| 53 | +// MEMP_NUM_TCP_SEG: Number of simultaneously queued TCP segments. Default is 16. |
| 54 | +#define MEMP_NUM_TCP_SEG 16 |
| 55 | +// MEMP_NUM_ALTCP_PCB: Number of simultaneously active altcp connections. Default is 5. |
| 56 | +#define MEMP_NUM_ALTCP_PCB 5 |
| 57 | +// MEMP_NUM_REASSDATA: Number of simultaneously IP packets queued for reassembly. Default is 5. |
| 58 | +#define MEMP_NUM_REASSDATA 5 |
| 59 | +// MEMP_NUM_FRAG_PBUF: Number of simultaneously IP fragments. Default is 15. |
| 60 | +#define MEMP_NUM_FRAG_PBUF 15 |
| 61 | +// MEMP_NUM_ARP_QUEUE: Number of simultaneously queued ARP packets. Default is 30. |
| 62 | +#define MEMP_NUM_ARP_QUEUE 30 |
| 63 | +// MEMP_NUM_IGMP_GROUP: Number of simultaneously active IGMP groups. Default is 8. |
| 64 | +#define MEMP_NUM_IGMP_GROUP 8 |
| 65 | +// MEMP_NUM_SYS_TIMEOUT: Number of simultaneously active timeouts. |
| 66 | +// Use calculated default based on enabled modules. |
| 67 | + |
| 68 | +// PBUF_POOL_SIZE: Number of pbufs in the pbuf pool. Default is 16. |
| 69 | +#define PBUF_POOL_SIZE 16 |
| 70 | + |
| 71 | +// LWIP's default 250 ms periodic timer interval is too long, resulting in network |
| 72 | +// performance issues. We reduce it to 25 ms giving a slow-timer of 50 ms and a |
| 73 | +// fast-timer of 25 ms. |
| 74 | +#define TCP_TMR_INTERVAL 25 |
| 75 | + |
27 | 76 | #define LWIP_ARP 1
|
28 | 77 | #define LWIP_ETHERNET 1
|
29 | 78 | #define LWIP_ICMP 1
|
30 | 79 | #define LWIP_RAW 1
|
| 80 | + |
31 | 81 | #define TCP_WND (8 * TCP_MSS)
|
32 | 82 | #define TCP_MSS 1460
|
33 | 83 | #define TCP_SND_BUF (8 * TCP_MSS)
|
|
0 commit comments