Trial code integration web page update with analogue data and ntp support
Dependencies: NTPClient_NetServices mbed
lpc1768/memp_std.h@0:8cc2035bebfc, 2010-08-06 (annotated)
- Committer:
- pmr1
- Date:
- Fri Aug 06 17:57:45 2010 +0000
- Revision:
- 0:8cc2035bebfc
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
pmr1 | 0:8cc2035bebfc | 1 | /* |
pmr1 | 0:8cc2035bebfc | 2 | * SETUP: Make sure we define everything we will need. |
pmr1 | 0:8cc2035bebfc | 3 | * |
pmr1 | 0:8cc2035bebfc | 4 | * We have create three types of pools: |
pmr1 | 0:8cc2035bebfc | 5 | * 1) MEMPOOL - standard pools |
pmr1 | 0:8cc2035bebfc | 6 | * 2) MALLOC_MEMPOOL - to be used by mem_malloc in mem.c |
pmr1 | 0:8cc2035bebfc | 7 | * 3) PBUF_MEMPOOL - a mempool of pbuf's, so include space for the pbuf struct |
pmr1 | 0:8cc2035bebfc | 8 | * |
pmr1 | 0:8cc2035bebfc | 9 | * If the include'r doesn't require any special treatment of each of the types |
pmr1 | 0:8cc2035bebfc | 10 | * above, then will declare #2 & #3 to be just standard mempools. |
pmr1 | 0:8cc2035bebfc | 11 | */ |
pmr1 | 0:8cc2035bebfc | 12 | #ifndef LWIP_MALLOC_MEMPOOL |
pmr1 | 0:8cc2035bebfc | 13 | /* This treats "malloc pools" just like any other pool. |
pmr1 | 0:8cc2035bebfc | 14 | The pools are a little bigger to provide 'size' as the amount of user data. */ |
pmr1 | 0:8cc2035bebfc | 15 | #define LWIP_MALLOC_MEMPOOL(num, size) LWIP_MEMPOOL(POOL_##size, num, (size + sizeof(struct memp_malloc_helper)), "MALLOC_"#size) |
pmr1 | 0:8cc2035bebfc | 16 | #define LWIP_MALLOC_MEMPOOL_START |
pmr1 | 0:8cc2035bebfc | 17 | #define LWIP_MALLOC_MEMPOOL_END |
pmr1 | 0:8cc2035bebfc | 18 | #endif /* LWIP_MALLOC_MEMPOOL */ |
pmr1 | 0:8cc2035bebfc | 19 | |
pmr1 | 0:8cc2035bebfc | 20 | #ifndef LWIP_PBUF_MEMPOOL |
pmr1 | 0:8cc2035bebfc | 21 | /* This treats "pbuf pools" just like any other pool. |
pmr1 | 0:8cc2035bebfc | 22 | * Allocates buffers for a pbuf struct AND a payload size */ |
pmr1 | 0:8cc2035bebfc | 23 | #define LWIP_PBUF_MEMPOOL(name, num, payload, desc) LWIP_MEMPOOL(name, num, (MEMP_ALIGN_SIZE(sizeof(struct pbuf)) + MEMP_ALIGN_SIZE(payload)), desc) |
pmr1 | 0:8cc2035bebfc | 24 | #endif /* LWIP_PBUF_MEMPOOL */ |
pmr1 | 0:8cc2035bebfc | 25 | |
pmr1 | 0:8cc2035bebfc | 26 | |
pmr1 | 0:8cc2035bebfc | 27 | /* |
pmr1 | 0:8cc2035bebfc | 28 | * A list of internal pools used by LWIP. |
pmr1 | 0:8cc2035bebfc | 29 | * |
pmr1 | 0:8cc2035bebfc | 30 | * LWIP_MEMPOOL(pool_name, number_elements, element_size, pool_description) |
pmr1 | 0:8cc2035bebfc | 31 | * creates a pool name MEMP_pool_name. description is used in stats.c |
pmr1 | 0:8cc2035bebfc | 32 | */ |
pmr1 | 0:8cc2035bebfc | 33 | #if LWIP_RAW |
pmr1 | 0:8cc2035bebfc | 34 | LWIP_MEMPOOL(RAW_PCB, MEMP_NUM_RAW_PCB, sizeof(struct raw_pcb), "RAW_PCB") |
pmr1 | 0:8cc2035bebfc | 35 | #endif /* LWIP_RAW */ |
pmr1 | 0:8cc2035bebfc | 36 | |
pmr1 | 0:8cc2035bebfc | 37 | #if LWIP_UDP |
pmr1 | 0:8cc2035bebfc | 38 | LWIP_MEMPOOL(UDP_PCB, MEMP_NUM_UDP_PCB, sizeof(struct udp_pcb), "UDP_PCB") |
pmr1 | 0:8cc2035bebfc | 39 | #endif /* LWIP_UDP */ |
pmr1 | 0:8cc2035bebfc | 40 | |
pmr1 | 0:8cc2035bebfc | 41 | #if LWIP_TCP |
pmr1 | 0:8cc2035bebfc | 42 | LWIP_MEMPOOL(TCP_PCB, MEMP_NUM_TCP_PCB, sizeof(struct tcp_pcb), "TCP_PCB") |
pmr1 | 0:8cc2035bebfc | 43 | LWIP_MEMPOOL(TCP_PCB_LISTEN, MEMP_NUM_TCP_PCB_LISTEN, sizeof(struct tcp_pcb_listen), "TCP_PCB_LISTEN") |
pmr1 | 0:8cc2035bebfc | 44 | LWIP_MEMPOOL(TCP_SEG, MEMP_NUM_TCP_SEG, sizeof(struct tcp_seg), "TCP_SEG") |
pmr1 | 0:8cc2035bebfc | 45 | #endif /* LWIP_TCP */ |
pmr1 | 0:8cc2035bebfc | 46 | |
pmr1 | 0:8cc2035bebfc | 47 | #if IP_REASSEMBLY |
pmr1 | 0:8cc2035bebfc | 48 | LWIP_MEMPOOL(REASSDATA, MEMP_NUM_REASSDATA, sizeof(struct ip_reassdata), "REASSDATA") |
pmr1 | 0:8cc2035bebfc | 49 | #endif /* IP_REASSEMBLY */ |
pmr1 | 0:8cc2035bebfc | 50 | |
pmr1 | 0:8cc2035bebfc | 51 | #if LWIP_NETCONN |
pmr1 | 0:8cc2035bebfc | 52 | LWIP_MEMPOOL(NETBUF, MEMP_NUM_NETBUF, sizeof(struct netbuf), "NETBUF") |
pmr1 | 0:8cc2035bebfc | 53 | LWIP_MEMPOOL(NETCONN, MEMP_NUM_NETCONN, sizeof(struct netconn), "NETCONN") |
pmr1 | 0:8cc2035bebfc | 54 | #endif /* LWIP_NETCONN */ |
pmr1 | 0:8cc2035bebfc | 55 | |
pmr1 | 0:8cc2035bebfc | 56 | #if NO_SYS==0 |
pmr1 | 0:8cc2035bebfc | 57 | LWIP_MEMPOOL(TCPIP_MSG_API, MEMP_NUM_TCPIP_MSG_API, sizeof(struct tcpip_msg), "TCPIP_MSG_API") |
pmr1 | 0:8cc2035bebfc | 58 | LWIP_MEMPOOL(TCPIP_MSG_INPKT,MEMP_NUM_TCPIP_MSG_INPKT, sizeof(struct tcpip_msg), "TCPIP_MSG_INPKT") |
pmr1 | 0:8cc2035bebfc | 59 | #endif /* NO_SYS==0 */ |
pmr1 | 0:8cc2035bebfc | 60 | |
pmr1 | 0:8cc2035bebfc | 61 | #if ARP_QUEUEING |
pmr1 | 0:8cc2035bebfc | 62 | LWIP_MEMPOOL(ARP_QUEUE, MEMP_NUM_ARP_QUEUE, sizeof(struct etharp_q_entry), "ARP_QUEUE") |
pmr1 | 0:8cc2035bebfc | 63 | #endif /* ARP_QUEUEING */ |
pmr1 | 0:8cc2035bebfc | 64 | |
pmr1 | 0:8cc2035bebfc | 65 | #if LWIP_IGMP |
pmr1 | 0:8cc2035bebfc | 66 | LWIP_MEMPOOL(IGMP_GROUP, MEMP_NUM_IGMP_GROUP, sizeof(struct igmp_group), "IGMP_GROUP") |
pmr1 | 0:8cc2035bebfc | 67 | #endif /* LWIP_IGMP */ |
pmr1 | 0:8cc2035bebfc | 68 | |
pmr1 | 0:8cc2035bebfc | 69 | LWIP_MEMPOOL(SYS_TIMEOUT, MEMP_NUM_SYS_TIMEOUT, sizeof(struct sys_timeo), "SYS_TIMEOUT") |
pmr1 | 0:8cc2035bebfc | 70 | |
pmr1 | 0:8cc2035bebfc | 71 | #if LWIP_SNMP |
pmr1 | 0:8cc2035bebfc | 72 | LWIP_MEMPOOL(SNMP_ROOTNODE, MEMP_NUM_SNMP_ROOTNODE, sizeof(struct mib_list_rootnode), "SNMP_ROOTNODE") |
pmr1 | 0:8cc2035bebfc | 73 | LWIP_MEMPOOL(SNMP_NODE, MEMP_NUM_SNMP_NODE, sizeof(struct mib_list_node), "SNMP_NODE") |
pmr1 | 0:8cc2035bebfc | 74 | LWIP_MEMPOOL(SNMP_VARBIND, MEMP_NUM_SNMP_VARBIND, sizeof(struct snmp_varbind), "SNMP_VARBIND") |
pmr1 | 0:8cc2035bebfc | 75 | LWIP_MEMPOOL(SNMP_VALUE, MEMP_NUM_SNMP_VALUE, SNMP_MAX_VALUE_SIZE, "SNMP_VALUE") |
pmr1 | 0:8cc2035bebfc | 76 | #endif /* LWIP_SNMP */ |
pmr1 | 0:8cc2035bebfc | 77 | #if LWIP_DNS && LWIP_SOCKET |
pmr1 | 0:8cc2035bebfc | 78 | LWIP_MEMPOOL(NETDB, MEMP_NUM_NETDB, NETDB_ELEM_SIZE, "NETDB") |
pmr1 | 0:8cc2035bebfc | 79 | #endif /* LWIP_DNS && LWIP_SOCKET */ |
pmr1 | 0:8cc2035bebfc | 80 | |
pmr1 | 0:8cc2035bebfc | 81 | /* |
pmr1 | 0:8cc2035bebfc | 82 | * A list of pools of pbuf's used by LWIP. |
pmr1 | 0:8cc2035bebfc | 83 | * |
pmr1 | 0:8cc2035bebfc | 84 | * LWIP_PBUF_MEMPOOL(pool_name, number_elements, pbuf_payload_size, pool_description) |
pmr1 | 0:8cc2035bebfc | 85 | * creates a pool name MEMP_pool_name. description is used in stats.c |
pmr1 | 0:8cc2035bebfc | 86 | * This allocates enough space for the pbuf struct and a payload. |
pmr1 | 0:8cc2035bebfc | 87 | * (Example: pbuf_payload_size=0 allocates only size for the struct) |
pmr1 | 0:8cc2035bebfc | 88 | */ |
pmr1 | 0:8cc2035bebfc | 89 | LWIP_PBUF_MEMPOOL(PBUF, MEMP_NUM_PBUF, 0, "PBUF_REF/ROM") |
pmr1 | 0:8cc2035bebfc | 90 | LWIP_PBUF_MEMPOOL(PBUF_POOL, PBUF_POOL_SIZE, PBUF_POOL_BUFSIZE, "PBUF_POOL") |
pmr1 | 0:8cc2035bebfc | 91 | |
pmr1 | 0:8cc2035bebfc | 92 | |
pmr1 | 0:8cc2035bebfc | 93 | /* |
pmr1 | 0:8cc2035bebfc | 94 | * Allow for user-defined pools; this must be explicitly set in lwipopts.h |
pmr1 | 0:8cc2035bebfc | 95 | * since the default is to NOT look for lwippools.h |
pmr1 | 0:8cc2035bebfc | 96 | */ |
pmr1 | 0:8cc2035bebfc | 97 | #if MEMP_USE_CUSTOM_POOLS |
pmr1 | 0:8cc2035bebfc | 98 | #include "lwippools.h" |
pmr1 | 0:8cc2035bebfc | 99 | #endif /* MEMP_USE_CUSTOM_POOLS */ |
pmr1 | 0:8cc2035bebfc | 100 | |
pmr1 | 0:8cc2035bebfc | 101 | /* |
pmr1 | 0:8cc2035bebfc | 102 | * REQUIRED CLEANUP: Clear up so we don't get "multiply defined" error later |
pmr1 | 0:8cc2035bebfc | 103 | * (#undef is ignored for something that is not defined) |
pmr1 | 0:8cc2035bebfc | 104 | */ |
pmr1 | 0:8cc2035bebfc | 105 | #undef LWIP_MEMPOOL |
pmr1 | 0:8cc2035bebfc | 106 | #undef LWIP_MALLOC_MEMPOOL |
pmr1 | 0:8cc2035bebfc | 107 | #undef LWIP_MALLOC_MEMPOOL_START |
pmr1 | 0:8cc2035bebfc | 108 | #undef LWIP_MALLOC_MEMPOOL_END |
pmr1 | 0:8cc2035bebfc | 109 | #undef LWIP_PBUF_MEMPOOL |