-
Notifications
You must be signed in to change notification settings - Fork 9
/
debug.h
28 lines (17 loc) · 695 Bytes
/
debug.h
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
/* This software is licensed under the MIT License: https://github.com/spacehuhntech/usbnova */
#pragma once
#include <Arduino.h>
#include "config.h"
#ifdef ENABLE_DEBUG
#define debug_init() DEBUG_PORT.begin(DEBUG_BAUD);
#define debugF(...) if (DEBUG_PORT) DEBUG_PORT.print(F(__VA_ARGS__))
#define debuglnF(...) if (DEBUG_PORT) DEBUG_PORT.println(F(__VA_ARGS__))
#define debug(...) if (DEBUG_PORT) DEBUG_PORT.print(__VA_ARGS__)
#define debugln(...) if (DEBUG_PORT) DEBUG_PORT.println(__VA_ARGS__)
#else /* ifdef ENABLE_DEBUG */
#define debug_init() Serial.end();
#define debugF(...) 0
#define debuglnF(...) 0
#define debug(...) 0
#define debugln(...) 0
#endif /* ifdef ENABLE_DEBUG */