-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
78 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,26 @@ | ||
#pragma once | ||
#ifdef DEBUG | ||
|
||
#ifdef SerialMon | ||
namespace { | ||
static void DBG_SETUP(unsigned long baud) { | ||
SerialMon.begin(baud); | ||
while (!SerialMon); | ||
} | ||
|
||
template <typename T> | ||
static void DBG_PLAIN(T last) { | ||
SerialMon.println(last); | ||
static void AM_DBG_PLAIN(T last) { | ||
DEBUG.println(last); | ||
} | ||
|
||
template <typename T, typename... Args> | ||
static void DBG_PLAIN(T head, Args... tail) { | ||
SerialMon.print(head); | ||
SerialMon.print(' '); | ||
static void AM_DBG_PLAIN(T head, Args... tail) { | ||
DEBUG.print(head); | ||
DEBUG.print(' '); | ||
DBG_PLAIN(tail...); | ||
} | ||
|
||
template <typename... Args> | ||
static void DBG(Args... args) { | ||
static void AM_DBG(Args... args) { | ||
DBG_PLAIN(args...); | ||
} | ||
} // namespace | ||
|
||
#else | ||
#define DBG_SETUP(...) | ||
#define DBG_PLAIN(...) | ||
#define DBG(...) | ||
#define AM_DBG_PLAIN(...) | ||
#define AM_DBG(...) | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.