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