123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
-
- #ifndef MBED_DEBUG_H
- #define MBED_DEBUG_H
- #include "device.h"
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- #if DEVICE_STDIO_MESSAGES
- #include <stdio.h>
- #include <stdarg.h>
-
-
- static inline void debug(const char *format, ...) {
- va_list args;
- va_start(args, format);
- vfprintf(stderr, format, args);
- va_end(args);
- }
-
-
- static inline void debug_if(int condition, const char *format, ...) {
- if (condition == 1) {
- va_list args;
- va_start(args, format);
- vfprintf(stderr, format, args);
- va_end(args);
- }
- }
-
- #else
- static inline void debug(const char *format, ...) {}
- static inline void debug_if(int condition, const char *format, ...) {}
-
- #endif
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif
|