-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathdebug.h
More file actions
45 lines (33 loc) · 718 Bytes
/
debug.h
File metadata and controls
45 lines (33 loc) · 718 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
* Flybrix Flight Controller -- Copyright 2018 Flying Selfie Inc. d/b/a Flybrix
*
* http://www.flybrix.com
*/
#ifndef debug_h
#define debug_h
#ifdef TESTSUITE
template <class... T>
void DebugPrint(T... args) {
}
template <class... T>
void DebugPrintf(T... args) {
}
#else
#include "Arduino.h"
class SerialComm;
extern SerialComm* debug_serial_comm;
void DebugSendString(const String& string);
template <class... T>
void DebugPrint(T... args) {
DebugSendString(String(args...));
}
template <class... T>
void DebugPrintf(T... args) {
if (!debug_serial_comm)
return;
char print_buffer[500];
sprintf(print_buffer, args...);
DebugPrint(print_buffer);
}
#endif
#endif