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