source: arduino-1-6-7/trunk/fuentes/arduino-ide-amd64/hardware/arduino/avr/firmwares/wifishield/wifiHD/src/SOFTWARE_FRAMEWORK/SERVICES/LWIP/lwip-1.3.2/src/include/lwip/debug.h @ 4837

Last change on this file since 4837 was 4837, checked in by daduve, 3 years ago

Adding new version

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