Implemented first Hangar-Service
Dependencies: CalibrateMagneto QuaternionMath
Fork of SML2 by
Logger.h@0:943820483318, 2015-01-13 (annotated)
- Committer:
- pvaibhav
- Date:
- Tue Jan 13 11:23:01 2015 +0000
- Revision:
- 0:943820483318
- Child:
- 1:c279bc3af90c
Initial commit with working LED and motor drivers.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
pvaibhav | 0:943820483318 | 1 | #ifndef _H_LOGGER_H |
pvaibhav | 0:943820483318 | 2 | #define _H_LOGGER_H |
pvaibhav | 0:943820483318 | 3 | |
pvaibhav | 0:943820483318 | 4 | #include <cstdio> |
pvaibhav | 0:943820483318 | 5 | #ifdef DEBUG |
pvaibhav | 0:943820483318 | 6 | static Serial sml2uart(p26, p24); |
pvaibhav | 0:943820483318 | 7 | #define LOG(x, ...) { sml2uart.printf("[ %s %3d] "x"\r\n", DEBUG, __LINE__, ##__VA_ARGS__); fflush(stdout); } |
pvaibhav | 0:943820483318 | 8 | #define WARN(x, ...) { sml2uart.printf("[W %s %3d] "x"\r\n", DEBUG, __LINE__, ##__VA_ARGS__); fflush(stdout); } |
pvaibhav | 0:943820483318 | 9 | #define ERR(x, ...) { sml2uart.printf("[E %s %3d] "x"\r\n", DEBUG, __LINE__, ##__VA_ARGS__); fflush(stdout); } |
pvaibhav | 0:943820483318 | 10 | #define INFO(x, ...) { sml2uart.printf("[i %s %3d] "x"\r\n", DEBUG, __LINE__, ##__VA_ARGS__); fflush(stdout); } |
pvaibhav | 0:943820483318 | 11 | #else |
pvaibhav | 0:943820483318 | 12 | #define LOG(x, ...) |
pvaibhav | 0:943820483318 | 13 | #define WARN(x, ...) |
pvaibhav | 0:943820483318 | 14 | #define ERR(x, ...) |
pvaibhav | 0:943820483318 | 15 | #define INFO(x, ...) |
pvaibhav | 0:943820483318 | 16 | #endif |
pvaibhav | 0:943820483318 | 17 | |
pvaibhav | 0:943820483318 | 18 | #endif//_H_LOGGER_H |