mbeduino + Weatherduino Weather Stations post test

Dependencies:   mbed

Committer:
okini3939
Date:
Tue Oct 26 17:19:28 2010 +0000
Revision:
0:10bcaa7c2253

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
okini3939 0:10bcaa7c2253 1 /*
okini3939 0:10bcaa7c2253 2 * Copyright (c) 2001-2004 Swedish Institute of Computer Science.
okini3939 0:10bcaa7c2253 3 * All rights reserved.
okini3939 0:10bcaa7c2253 4 *
okini3939 0:10bcaa7c2253 5 * Redistribution and use in source and binary forms, with or without modification,
okini3939 0:10bcaa7c2253 6 * are permitted provided that the following conditions are met:
okini3939 0:10bcaa7c2253 7 *
okini3939 0:10bcaa7c2253 8 * 1. Redistributions of source code must retain the above copyright notice,
okini3939 0:10bcaa7c2253 9 * this list of conditions and the following disclaimer.
okini3939 0:10bcaa7c2253 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
okini3939 0:10bcaa7c2253 11 * this list of conditions and the following disclaimer in the documentation
okini3939 0:10bcaa7c2253 12 * and/or other materials provided with the distribution.
okini3939 0:10bcaa7c2253 13 * 3. The name of the author may not be used to endorse or promote products
okini3939 0:10bcaa7c2253 14 * derived from this software without specific prior written permission.
okini3939 0:10bcaa7c2253 15 *
okini3939 0:10bcaa7c2253 16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
okini3939 0:10bcaa7c2253 17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
okini3939 0:10bcaa7c2253 18 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
okini3939 0:10bcaa7c2253 19 * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
okini3939 0:10bcaa7c2253 20 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
okini3939 0:10bcaa7c2253 21 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
okini3939 0:10bcaa7c2253 22 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
okini3939 0:10bcaa7c2253 23 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
okini3939 0:10bcaa7c2253 24 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
okini3939 0:10bcaa7c2253 25 * OF SUCH DAMAGE.
okini3939 0:10bcaa7c2253 26 *
okini3939 0:10bcaa7c2253 27 * This file is part of the lwIP TCP/IP stack.
okini3939 0:10bcaa7c2253 28 *
okini3939 0:10bcaa7c2253 29 * Author: Adam Dunkels <adam@sics.se>
okini3939 0:10bcaa7c2253 30 *
okini3939 0:10bcaa7c2253 31 */
okini3939 0:10bcaa7c2253 32
okini3939 0:10bcaa7c2253 33 #ifndef __LWIP_MEMP_H__
okini3939 0:10bcaa7c2253 34 #define __LWIP_MEMP_H__
okini3939 0:10bcaa7c2253 35
okini3939 0:10bcaa7c2253 36 #include "lwip/opt.h"
okini3939 0:10bcaa7c2253 37
okini3939 0:10bcaa7c2253 38 #ifdef __cplusplus
okini3939 0:10bcaa7c2253 39 extern "C" {
okini3939 0:10bcaa7c2253 40 #endif
okini3939 0:10bcaa7c2253 41
okini3939 0:10bcaa7c2253 42 /* Create the list of all memory pools managed by memp. MEMP_MAX represents a NULL pool at the end */
okini3939 0:10bcaa7c2253 43 typedef enum {
okini3939 0:10bcaa7c2253 44 #define LWIP_MEMPOOL(name,num,size,desc) MEMP_##name,
okini3939 0:10bcaa7c2253 45 #include "lwip/memp_std.h"
okini3939 0:10bcaa7c2253 46 MEMP_MAX
okini3939 0:10bcaa7c2253 47 } memp_t;
okini3939 0:10bcaa7c2253 48
okini3939 0:10bcaa7c2253 49 #if MEM_USE_POOLS
okini3939 0:10bcaa7c2253 50 /* Use a helper type to get the start and end of the user "memory pools" for mem_malloc */
okini3939 0:10bcaa7c2253 51 typedef enum {
okini3939 0:10bcaa7c2253 52 /* Get the first (via:
okini3939 0:10bcaa7c2253 53 MEMP_POOL_HELPER_START = ((u8_t) 1*MEMP_POOL_A + 0*MEMP_POOL_B + 0*MEMP_POOL_C + 0)*/
okini3939 0:10bcaa7c2253 54 MEMP_POOL_HELPER_FIRST = ((u8_t)
okini3939 0:10bcaa7c2253 55 #define LWIP_MEMPOOL(name,num,size,desc)
okini3939 0:10bcaa7c2253 56 #define LWIP_MALLOC_MEMPOOL_START 1
okini3939 0:10bcaa7c2253 57 #define LWIP_MALLOC_MEMPOOL(num, size) * MEMP_POOL_##size + 0
okini3939 0:10bcaa7c2253 58 #define LWIP_MALLOC_MEMPOOL_END
okini3939 0:10bcaa7c2253 59 #include "lwip/memp_std.h"
okini3939 0:10bcaa7c2253 60 ) ,
okini3939 0:10bcaa7c2253 61 /* Get the last (via:
okini3939 0:10bcaa7c2253 62 MEMP_POOL_HELPER_END = ((u8_t) 0 + MEMP_POOL_A*0 + MEMP_POOL_B*0 + MEMP_POOL_C*1) */
okini3939 0:10bcaa7c2253 63 MEMP_POOL_HELPER_LAST = ((u8_t)
okini3939 0:10bcaa7c2253 64 #define LWIP_MEMPOOL(name,num,size,desc)
okini3939 0:10bcaa7c2253 65 #define LWIP_MALLOC_MEMPOOL_START
okini3939 0:10bcaa7c2253 66 #define LWIP_MALLOC_MEMPOOL(num, size) 0 + MEMP_POOL_##size *
okini3939 0:10bcaa7c2253 67 #define LWIP_MALLOC_MEMPOOL_END 1
okini3939 0:10bcaa7c2253 68 #include "lwip/memp_std.h"
okini3939 0:10bcaa7c2253 69 )
okini3939 0:10bcaa7c2253 70 } memp_pool_helper_t;
okini3939 0:10bcaa7c2253 71
okini3939 0:10bcaa7c2253 72 /* The actual start and stop values are here (cast them over)
okini3939 0:10bcaa7c2253 73 We use this helper type and these defines so we can avoid using const memp_t values */
okini3939 0:10bcaa7c2253 74 #define MEMP_POOL_FIRST ((memp_t) MEMP_POOL_HELPER_FIRST)
okini3939 0:10bcaa7c2253 75 #define MEMP_POOL_LAST ((memp_t) MEMP_POOL_HELPER_LAST)
okini3939 0:10bcaa7c2253 76 #endif /* MEM_USE_POOLS */
okini3939 0:10bcaa7c2253 77
okini3939 0:10bcaa7c2253 78 #if MEMP_MEM_MALLOC || MEM_USE_POOLS
okini3939 0:10bcaa7c2253 79 extern const u16_t memp_sizes[MEMP_MAX];
okini3939 0:10bcaa7c2253 80 #endif /* MEMP_MEM_MALLOC || MEM_USE_POOLS */
okini3939 0:10bcaa7c2253 81
okini3939 0:10bcaa7c2253 82 #if MEMP_MEM_MALLOC
okini3939 0:10bcaa7c2253 83
okini3939 0:10bcaa7c2253 84 #include "mem.h"
okini3939 0:10bcaa7c2253 85
okini3939 0:10bcaa7c2253 86 #define memp_init()
okini3939 0:10bcaa7c2253 87 #define memp_malloc(type) mem_malloc(memp_sizes[type])
okini3939 0:10bcaa7c2253 88 #define memp_free(type, mem) mem_free(mem)
okini3939 0:10bcaa7c2253 89
okini3939 0:10bcaa7c2253 90 #else /* MEMP_MEM_MALLOC */
okini3939 0:10bcaa7c2253 91
okini3939 0:10bcaa7c2253 92 #if MEM_USE_POOLS
okini3939 0:10bcaa7c2253 93 /** This structure is used to save the pool one element came from. */
okini3939 0:10bcaa7c2253 94 struct memp_malloc_helper
okini3939 0:10bcaa7c2253 95 {
okini3939 0:10bcaa7c2253 96 memp_t poolnr;
okini3939 0:10bcaa7c2253 97 };
okini3939 0:10bcaa7c2253 98 #endif /* MEM_USE_POOLS */
okini3939 0:10bcaa7c2253 99
okini3939 0:10bcaa7c2253 100 void memp_init(void);
okini3939 0:10bcaa7c2253 101
okini3939 0:10bcaa7c2253 102 #if MEMP_OVERFLOW_CHECK
okini3939 0:10bcaa7c2253 103 void *memp_malloc_fn(memp_t type, const char* file, const int line);
okini3939 0:10bcaa7c2253 104 #define memp_malloc(t) memp_malloc_fn((t), __FILE__, __LINE__)
okini3939 0:10bcaa7c2253 105 #else
okini3939 0:10bcaa7c2253 106 void *memp_malloc(memp_t type);
okini3939 0:10bcaa7c2253 107 #endif
okini3939 0:10bcaa7c2253 108 void memp_free(memp_t type, void *mem);
okini3939 0:10bcaa7c2253 109
okini3939 0:10bcaa7c2253 110 #endif /* MEMP_MEM_MALLOC */
okini3939 0:10bcaa7c2253 111
okini3939 0:10bcaa7c2253 112 #ifdef __cplusplus
okini3939 0:10bcaa7c2253 113 }
okini3939 0:10bcaa7c2253 114 #endif
okini3939 0:10bcaa7c2253 115
okini3939 0:10bcaa7c2253 116 #endif /* __LWIP_MEMP_H__ */