mirror of
https://gitlab.com/Luci_/arduino-photometrics.git
synced 2026-04-03 11:35:37 +02:00
29 lines
702 B
C
29 lines
702 B
C
#ifndef DEBUG_CONFIG_H
|
|
#define DEBUG_CONFIG_H
|
|
|
|
#define DEBUG
|
|
|
|
#ifdef DEBUG
|
|
#define DLOG_INIT() Serial.begin(9600)
|
|
#define DLOG(msg) Serial.print(msg);
|
|
#define DLOGLN(msg) Serial.println(msg);
|
|
#define WARN_IF(cond, msg) if(cond) Serial.print(msg);
|
|
|
|
#define ASSERT(condition, msg) \
|
|
if (!(condition)) { \
|
|
Serial.print("!!! ASSERTION FAILED: "); \
|
|
Serial.print(msg); \
|
|
Serial.print(" [F:"); Serial.print(__FILE__); \
|
|
Serial.print(" L:"); Serial.print(__LINE__); \
|
|
Serial.println("]"); \
|
|
while (true); \
|
|
}
|
|
#else
|
|
#define DLOG_INIT()
|
|
#define DLOG(msg)
|
|
#define DLOGLN(msg)
|
|
#define WARN_IF(cond, msg)
|
|
#define ASSERT(condition, msg)
|
|
#endif
|
|
|
|
#endif |