Trial code integration web page update with analogue data and ntp support
Dependencies: NTPClient_NetServices mbed
lpc1768/services/http/util/debug.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 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. |
pmr1 | 0:8cc2035bebfc | 3 | * All rights reserved. |
pmr1 | 0:8cc2035bebfc | 4 | * |
pmr1 | 0:8cc2035bebfc | 5 | * Redistribution and use in source and binary forms, with or without modification, |
pmr1 | 0:8cc2035bebfc | 6 | * are permitted provided that the following conditions are met: |
pmr1 | 0:8cc2035bebfc | 7 | * |
pmr1 | 0:8cc2035bebfc | 8 | * 1. Redistributions of source code must retain the above copyright notice, |
pmr1 | 0:8cc2035bebfc | 9 | * this list of conditions and the following disclaimer. |
pmr1 | 0:8cc2035bebfc | 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
pmr1 | 0:8cc2035bebfc | 11 | * this list of conditions and the following disclaimer in the documentation |
pmr1 | 0:8cc2035bebfc | 12 | * and/or other materials provided with the distribution. |
pmr1 | 0:8cc2035bebfc | 13 | * 3. The name of the author may not be used to endorse or promote products |
pmr1 | 0:8cc2035bebfc | 14 | * derived from this software without specific prior written permission. |
pmr1 | 0:8cc2035bebfc | 15 | * |
pmr1 | 0:8cc2035bebfc | 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED |
pmr1 | 0:8cc2035bebfc | 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
pmr1 | 0:8cc2035bebfc | 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT |
pmr1 | 0:8cc2035bebfc | 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
pmr1 | 0:8cc2035bebfc | 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT |
pmr1 | 0:8cc2035bebfc | 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
pmr1 | 0:8cc2035bebfc | 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
pmr1 | 0:8cc2035bebfc | 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING |
pmr1 | 0:8cc2035bebfc | 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY |
pmr1 | 0:8cc2035bebfc | 25 | * OF SUCH DAMAGE. |
pmr1 | 0:8cc2035bebfc | 26 | * |
pmr1 | 0:8cc2035bebfc | 27 | * This file is part of the lwIP TCP/IP stack. |
pmr1 | 0:8cc2035bebfc | 28 | * |
pmr1 | 0:8cc2035bebfc | 29 | * Author: Adam Dunkels <adam@sics.se> |
pmr1 | 0:8cc2035bebfc | 30 | * |
pmr1 | 0:8cc2035bebfc | 31 | */ |
pmr1 | 0:8cc2035bebfc | 32 | #ifndef __LWIP_DEBUG_H__ |
pmr1 | 0:8cc2035bebfc | 33 | #define __LWIP_DEBUG_H__ |
pmr1 | 0:8cc2035bebfc | 34 | |
pmr1 | 0:8cc2035bebfc | 35 | #include "lwip/arch.h" |
pmr1 | 0:8cc2035bebfc | 36 | |
pmr1 | 0:8cc2035bebfc | 37 | /** lower two bits indicate debug level |
pmr1 | 0:8cc2035bebfc | 38 | * - 0 all |
pmr1 | 0:8cc2035bebfc | 39 | * - 1 warning |
pmr1 | 0:8cc2035bebfc | 40 | * - 2 serious |
pmr1 | 0:8cc2035bebfc | 41 | * - 3 severe |
pmr1 | 0:8cc2035bebfc | 42 | */ |
pmr1 | 0:8cc2035bebfc | 43 | #define LWIP_DBG_LEVEL_ALL 0x00 |
pmr1 | 0:8cc2035bebfc | 44 | #define LWIP_DBG_LEVEL_OFF LWIP_DBG_LEVEL_ALL /* compatibility define only */ |
pmr1 | 0:8cc2035bebfc | 45 | #define LWIP_DBG_LEVEL_WARNING 0x01 /* bad checksums, dropped packets, ... */ |
pmr1 | 0:8cc2035bebfc | 46 | #define LWIP_DBG_LEVEL_SERIOUS 0x02 /* memory allocation failures, ... */ |
pmr1 | 0:8cc2035bebfc | 47 | #define LWIP_DBG_LEVEL_SEVERE 0x03 |
pmr1 | 0:8cc2035bebfc | 48 | #define LWIP_DBG_MASK_LEVEL 0x03 |
pmr1 | 0:8cc2035bebfc | 49 | |
pmr1 | 0:8cc2035bebfc | 50 | /** flag for LWIP_DEBUGF to enable that debug message */ |
pmr1 | 0:8cc2035bebfc | 51 | #define LWIP_DBG_ON 0x80U |
pmr1 | 0:8cc2035bebfc | 52 | /** flag for LWIP_DEBUGF to disable that debug message */ |
pmr1 | 0:8cc2035bebfc | 53 | #define LWIP_DBG_OFF 0x00U |
pmr1 | 0:8cc2035bebfc | 54 | |
pmr1 | 0:8cc2035bebfc | 55 | /** flag for LWIP_DEBUGF indicating a tracing message (to follow program flow) */ |
pmr1 | 0:8cc2035bebfc | 56 | #define LWIP_DBG_TRACE 0x40U |
pmr1 | 0:8cc2035bebfc | 57 | /** flag for LWIP_DEBUGF indicating a state debug message (to follow module states) */ |
pmr1 | 0:8cc2035bebfc | 58 | #define LWIP_DBG_STATE 0x20U |
pmr1 | 0:8cc2035bebfc | 59 | /** flag for LWIP_DEBUGF indicating newly added code, not thoroughly tested yet */ |
pmr1 | 0:8cc2035bebfc | 60 | #define LWIP_DBG_FRESH 0x10U |
pmr1 | 0:8cc2035bebfc | 61 | /** flag for LWIP_DEBUGF to halt after printing this debug message */ |
pmr1 | 0:8cc2035bebfc | 62 | #define LWIP_DBG_HALT 0x08U |
pmr1 | 0:8cc2035bebfc | 63 | |
pmr1 | 0:8cc2035bebfc | 64 | #ifndef LWIP_NOASSERT |
pmr1 | 0:8cc2035bebfc | 65 | #define LWIP_ASSERT(message, assertion) do { if(!(assertion)) \ |
pmr1 | 0:8cc2035bebfc | 66 | LWIP_PLATFORM_ASSERT(message); } while(0) |
pmr1 | 0:8cc2035bebfc | 67 | #else /* LWIP_NOASSERT */ |
pmr1 | 0:8cc2035bebfc | 68 | #define LWIP_ASSERT(message, assertion) |
pmr1 | 0:8cc2035bebfc | 69 | #endif /* LWIP_NOASSERT */ |
pmr1 | 0:8cc2035bebfc | 70 | |
pmr1 | 0:8cc2035bebfc | 71 | /** if "expression" isn't true, then print "message" and execute "handler" expression */ |
pmr1 | 0:8cc2035bebfc | 72 | #ifndef LWIP_ERROR |
pmr1 | 0:8cc2035bebfc | 73 | #define LWIP_ERROR(message, expression, handler) do { if (!(expression)) { \ |
pmr1 | 0:8cc2035bebfc | 74 | LWIP_PLATFORM_ASSERT(message); handler;}} while(0) |
pmr1 | 0:8cc2035bebfc | 75 | #endif /* LWIP_ERROR */ |
pmr1 | 0:8cc2035bebfc | 76 | |
pmr1 | 0:8cc2035bebfc | 77 | #ifdef LWIP_DEBUG |
pmr1 | 0:8cc2035bebfc | 78 | /** print debug message only if debug message type is enabled... |
pmr1 | 0:8cc2035bebfc | 79 | * AND is of correct type AND is at least LWIP_DBG_LEVEL |
pmr1 | 0:8cc2035bebfc | 80 | */ |
pmr1 | 0:8cc2035bebfc | 81 | #define LWIP_DEBUGF(debug, message) do { \ |
pmr1 | 0:8cc2035bebfc | 82 | if ( \ |
pmr1 | 0:8cc2035bebfc | 83 | ((debug) & LWIP_DBG_ON) && \ |
pmr1 | 0:8cc2035bebfc | 84 | ((debug) & LWIP_DBG_TYPES_ON) && \ |
pmr1 | 0:8cc2035bebfc | 85 | ((s16_t)((debug) & LWIP_DBG_MASK_LEVEL) >= LWIP_DBG_MIN_LEVEL)) { \ |
pmr1 | 0:8cc2035bebfc | 86 | LWIP_PLATFORM_DIAG(message); \ |
pmr1 | 0:8cc2035bebfc | 87 | if ((debug) & LWIP_DBG_HALT) { \ |
pmr1 | 0:8cc2035bebfc | 88 | while(1); \ |
pmr1 | 0:8cc2035bebfc | 89 | } \ |
pmr1 | 0:8cc2035bebfc | 90 | } \ |
pmr1 | 0:8cc2035bebfc | 91 | } while(0) |
pmr1 | 0:8cc2035bebfc | 92 | |
pmr1 | 0:8cc2035bebfc | 93 | #else /* LWIP_DEBUG */ |
pmr1 | 0:8cc2035bebfc | 94 | #define LWIP_DEBUGF(debug, message) |
pmr1 | 0:8cc2035bebfc | 95 | #endif /* LWIP_DEBUG */ |
pmr1 | 0:8cc2035bebfc | 96 | |
pmr1 | 0:8cc2035bebfc | 97 | #endif /* __LWIP_DEBUG_H__ */ |
pmr1 | 0:8cc2035bebfc | 98 |