Give water to plants if dry amd pla meanwhile music the music vou can define with note length bind and breake also select several instruments for the sound

Dependencies:   mbed

Committer:
helmut
Date:
Wed Sep 19 14:16:56 2012 +0000
Revision:
0:5150b09127e3
plays mostly music that you can do with notes length breakes and bind; Some already defined; Tool is to start a pump for water to give plant is too dry.; Meanwhie plays music the most part of all

Who changed what in which revision?

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