Original lib
Fork of SX1276Lib by
Revision 19:452450d0b8c0, committed 2016-03-06
- Comitter:
- donsez
- Date:
- Sun Mar 06 11:08:53 2016 +0000
- Parent:
- 18:71a47bb03fbb
- Commit message:
- refactor PingPong in order to have a AT LoRa modem (sender and receiver)
Changed in this revision
debug/debug.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/debug/debug.h Wed Aug 12 14:34:03 2015 +0000 +++ b/debug/debug.h Sun Mar 06 11:08:53 2016 +0000 @@ -26,14 +26,17 @@ #include <stdarg.h> #include <stdio.h> +extern Serial pc; + + /** Output a debug message * * @param format printf-style format string, followed by variables */ -static inline void debug(const char *format, ...) { +static inline void sx_debug(const char *format, ...) { va_list args; va_start(args, format); - vfprintf(stderr, format, args); + pc.printf(format, args); va_end(args); } @@ -42,19 +45,19 @@ * @param condition output only if condition is true * @param format printf-style format string, followed by variables */ -static inline void debug_if(bool condition, const char *format, ...) { +static inline void sx_debug_if(bool condition, const char *format, ...) { if(condition) { va_list args; va_start(args, format); - vfprintf(stderr, format, args); + pc.printf(format, args); va_end(args); } } #else -static inline void debug(const char *format, ...) {} -static inline void debug(bool condition, const char *format, ...) {} +static inline void sx_debug(const char *format, ...) {} +static inline void sx_debug_if(bool condition, const char *format, ...) {} #endif