test

Dependencies:   EthernetInterface TextLCD mbed-rtos mbed

Committer:
y_notsu
Date:
Tue Jan 22 20:46:08 2013 +0000
Revision:
0:2b3659d0a56e
test

Who changed what in which revision?

UserRevisionLine numberNew contents of line
y_notsu 0:2b3659d0a56e 1
y_notsu 0:2b3659d0a56e 2 /*
y_notsu 0:2b3659d0a56e 3 Copyright (c) 2010 Donatien Garnier (donatiengar [at] gmail [dot] com)
y_notsu 0:2b3659d0a56e 4
y_notsu 0:2b3659d0a56e 5 Permission is hereby granted, free of charge, to any person obtaining a copy
y_notsu 0:2b3659d0a56e 6 of this software and associated documentation files (the "Software"), to deal
y_notsu 0:2b3659d0a56e 7 in the Software without restriction, including without limitation the rights
y_notsu 0:2b3659d0a56e 8 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
y_notsu 0:2b3659d0a56e 9 copies of the Software, and to permit persons to whom the Software is
y_notsu 0:2b3659d0a56e 10 furnished to do so, subject to the following conditions:
y_notsu 0:2b3659d0a56e 11
y_notsu 0:2b3659d0a56e 12 The above copyright notice and this permission notice shall be included in
y_notsu 0:2b3659d0a56e 13 all copies or substantial portions of the Software.
y_notsu 0:2b3659d0a56e 14
y_notsu 0:2b3659d0a56e 15 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
y_notsu 0:2b3659d0a56e 16 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
y_notsu 0:2b3659d0a56e 17 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
y_notsu 0:2b3659d0a56e 18 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
y_notsu 0:2b3659d0a56e 19 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
y_notsu 0:2b3659d0a56e 20 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
y_notsu 0:2b3659d0a56e 21 THE SOFTWARE.
y_notsu 0:2b3659d0a56e 22 */
y_notsu 0:2b3659d0a56e 23
y_notsu 0:2b3659d0a56e 24 /** \file
y_notsu 0:2b3659d0a56e 25 Debugging helpers header file
y_notsu 0:2b3659d0a56e 26 */
y_notsu 0:2b3659d0a56e 27
y_notsu 0:2b3659d0a56e 28 //#ifdef DBG_H
y_notsu 0:2b3659d0a56e 29 //#define DBG_H
y_notsu 0:2b3659d0a56e 30
y_notsu 0:2b3659d0a56e 31 #ifdef __LWIP_DEBUG
y_notsu 0:2b3659d0a56e 32 #define __DEBUG
y_notsu 0:2b3659d0a56e 33 #endif
y_notsu 0:2b3659d0a56e 34
y_notsu 0:2b3659d0a56e 35 /*!
y_notsu 0:2b3659d0a56e 36 \def __DEBUG
y_notsu 0:2b3659d0a56e 37 To define to enable debugging in one file
y_notsu 0:2b3659d0a56e 38 */
y_notsu 0:2b3659d0a56e 39
y_notsu 0:2b3659d0a56e 40 #ifdef __DEBUG
y_notsu 0:2b3659d0a56e 41
y_notsu 0:2b3659d0a56e 42 #ifndef __DEBUGSTREAM
y_notsu 0:2b3659d0a56e 43 #define __DEBUGSTREAM
y_notsu 0:2b3659d0a56e 44
y_notsu 0:2b3659d0a56e 45
y_notsu 0:2b3659d0a56e 46 class DebugStream
y_notsu 0:2b3659d0a56e 47 {
y_notsu 0:2b3659d0a56e 48 public:
y_notsu 0:2b3659d0a56e 49 static void debug(const char* format, ...);
y_notsu 0:2b3659d0a56e 50 static void release();
y_notsu 0:2b3659d0a56e 51 static void breakPoint(const char* file, int line);
y_notsu 0:2b3659d0a56e 52 private:
y_notsu 0:2b3659d0a56e 53
y_notsu 0:2b3659d0a56e 54 };
y_notsu 0:2b3659d0a56e 55
y_notsu 0:2b3659d0a56e 56 #undef DBG
y_notsu 0:2b3659d0a56e 57 #undef DBG_END
y_notsu 0:2b3659d0a56e 58 #undef BREAK
y_notsu 0:2b3659d0a56e 59
y_notsu 0:2b3659d0a56e 60 ///Debug output (if enabled), same syntax as printf, with heading info
y_notsu 0:2b3659d0a56e 61 #define DBG(...) do{ DebugStream::debug("[%s:%s@%d] ", __FILE__, __FUNCTION__, __LINE__); DebugStream::debug(__VA_ARGS__); } while(0);
y_notsu 0:2b3659d0a56e 62
y_notsu 0:2b3659d0a56e 63 ///Debug output (if enabled), same syntax as printf, no heading info
y_notsu 0:2b3659d0a56e 64 #define DBGL(...) do{ DebugStream::debug(__VA_ARGS__); } while(0);
y_notsu 0:2b3659d0a56e 65 #define DBG_END DebugStream::release
y_notsu 0:2b3659d0a56e 66
y_notsu 0:2b3659d0a56e 67 ///Break point usin serial debug interface (if debug enbaled)
y_notsu 0:2b3659d0a56e 68 #define BREAK() DebugStream::breakPoint(__FILE__, __LINE__)
y_notsu 0:2b3659d0a56e 69 #endif
y_notsu 0:2b3659d0a56e 70
y_notsu 0:2b3659d0a56e 71 #else
y_notsu 0:2b3659d0a56e 72 #undef DBG
y_notsu 0:2b3659d0a56e 73 #undef DBG_END
y_notsu 0:2b3659d0a56e 74 #undef BREAK
y_notsu 0:2b3659d0a56e 75 #define DBG(...)
y_notsu 0:2b3659d0a56e 76 #define DBG_END()
y_notsu 0:2b3659d0a56e 77 #define BREAK()
y_notsu 0:2b3659d0a56e 78 #endif
y_notsu 0:2b3659d0a56e 79
y_notsu 0:2b3659d0a56e 80 #ifdef __LWIP_DEBUG
y_notsu 0:2b3659d0a56e 81 #ifndef __SNPRINTF
y_notsu 0:2b3659d0a56e 82 #define __SNPRINTF
y_notsu 0:2b3659d0a56e 83 #include "mbed.h"
y_notsu 0:2b3659d0a56e 84
y_notsu 0:2b3659d0a56e 85 //int snprintf(char *str, int size, const char *format, ...);
y_notsu 0:2b3659d0a56e 86 #endif
y_notsu 0:2b3659d0a56e 87 #endif
y_notsu 0:2b3659d0a56e 88
y_notsu 0:2b3659d0a56e 89 #ifdef __LWIP_DEBUG
y_notsu 0:2b3659d0a56e 90 #undef __DEBUG
y_notsu 0:2b3659d0a56e 91 #endif
y_notsu 0:2b3659d0a56e 92
y_notsu 0:2b3659d0a56e 93 //#endif
y_notsu 0:2b3659d0a56e 94