LineLedControl

Dependencies:   LPD8806 mbed

Fork of LPD8806_Test by Jelmer Tiete

Committer:
sfjmt
Date:
Mon Aug 19 12:14:37 2013 +0000
Revision:
3:b0a1b4b24d3c
LPD8806 control

Who changed what in which revision?

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