EEEN21000
GROUP 30 Line Following Buggy
Loading...
Searching...
No Matches
debug1.h
Go to the documentation of this file.
1#ifndef DEBUG_H
2#define DEBUG_H
3
4#include <cstdio>
5
6// #define DEBUG
7// #define SENSORS_DEBUG
8
9#ifdef DEBUG
10#define _DEBUG 1
11#else
12#define _DEBUG 0
13#endif
14
15#define DEBUGLOG(x, ...) \
16 do { if (_DEBUG) { \
17 printf("[LOG] %s %s(): " x, \
18 __FILE__, __func__, ##__VA_ARGS__); \
19 fflush(stdout); }} while (0)
20
21#define ERROR(...) \
22 do { if (_DEBUG) { \
23 fprintf(stderr, "[ERROR] %s %s(): %s\n", \
24 __FILE__, __func__, ##__VA_ARGS__); \
25 fflush(stdout); __builtin_abort(); \
26 }} while (0)
27
28#endif