Formula Student Electronics & Software
The code for the embedded software
Loading...
Searching...
No Matches
debugUtils.hpp
Go to the documentation of this file.
1#pragma once
2
3#ifdef DEBUG
4#include <Arduino.h>
5#define DEBUG_PRINT(str) \
6 Serial.print(millis()); \
7 Serial.print(": "); \
8 Serial.print(__PRETTY_FUNCTION__); \
9 Serial.print(' '); \
10 Serial.print(__FILE__); \
11 Serial.print(':'); \
12 Serial.print(__LINE__); \
13 Serial.print(' '); \
14 Serial.println(str);
15
16#define DEBUG_PRINT_VAR(var) \
17 Serial.print(millis()); \
18 Serial.print(": "); \
19 Serial.print(__PRETTY_FUNCTION__); \
20 Serial.print(' '); \
21 Serial.print(__FILE__); \
22 Serial.print(':'); \
23 Serial.print(__LINE__); \
24 Serial.print(' '); \
25 Serial.print(#var); \
26 Serial.print(" = "); \
27 Serial.println(var);
28#else
29#define DEBUG_PRINT_VAR(var)
30#define DEBUG_PRINT(str)
31#endif