Jim Cooper
/
simple_debug
Simple sample of using a debug class and macros.
debug.cpp@0:885c11431d59, 2015-08-30 (annotated)
- Committer:
- jimcooper
- Date:
- Sun Aug 30 00:05:14 2015 +0000
- Revision:
- 0:885c11431d59
Simple example of using a debug object and macros.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jimcooper | 0:885c11431d59 | 1 | #include "mbed.h" |
jimcooper | 0:885c11431d59 | 2 | #include "debug.h" |
jimcooper | 0:885c11431d59 | 3 | |
jimcooper | 0:885c11431d59 | 4 | |
jimcooper | 0:885c11431d59 | 5 | Serial g_console(USBTX, USBRX); |
jimcooper | 0:885c11431d59 | 6 | |
jimcooper | 0:885c11431d59 | 7 | |
jimcooper | 0:885c11431d59 | 8 | #ifdef DEBUG |
jimcooper | 0:885c11431d59 | 9 | |
jimcooper | 0:885c11431d59 | 10 | debug g_debugger; |
jimcooper | 0:885c11431d59 | 11 | |
jimcooper | 0:885c11431d59 | 12 | |
jimcooper | 0:885c11431d59 | 13 | |
jimcooper | 0:885c11431d59 | 14 | void debug::error(const char* text) |
jimcooper | 0:885c11431d59 | 15 | { |
jimcooper | 0:885c11431d59 | 16 | g_console.printf("!!!!!!!!!!!!!!!!! %s\n", text); |
jimcooper | 0:885c11431d59 | 17 | } |
jimcooper | 0:885c11431d59 | 18 | |
jimcooper | 0:885c11431d59 | 19 | |
jimcooper | 0:885c11431d59 | 20 | #endif |