diff options
author | tmk <nobody@nowhere> | 2013-03-19 14:08:40 +0900 |
---|---|---|
committer | tmk <nobody@nowhere> | 2013-03-19 14:08:40 +0900 |
commit | 9a106537f64fe61af6048b41262f002ce6a716d9 (patch) | |
tree | 9df736d957945b5d3377b8cb5005946acd99bd61 /common/debug.h | |
parent | 8580c8d291a432d5004c46321aa3c1b1626cdadd (diff) | |
download | qmk_firmware-9a106537f64fe61af6048b41262f002ce6a716d9.tar.gz |
Add NO_PRINT and NO_DEBUG config options.
- NO_PRINT: disable print.h API(also disable debug.h)
- NO_DEBUG: disable debug.h API
Diffstat (limited to 'common/debug.h')
-rw-r--r-- | common/debug.h | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/common/debug.h b/common/debug.h index e63d46f0e..e16ea14af 100644 --- a/common/debug.h +++ b/common/debug.h @@ -22,6 +22,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "print.h" +#ifndef NO_DEBUG + #define debug(s) do { if (debug_enable) print(s); } while (0) #define debugln(s) do { if (debug_enable) println(s); } while (0) #define debug_S(s) do { if (debug_enable) print_S(s); } while (0) @@ -31,9 +33,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. print(__FILE__); print(" at "); print_dec(__LINE__); print(" in "); print(": "); print(s); \ } \ } while (0) - - - #define debug_dec(data) do { if (debug_enable) print_dec(data); } while (0) #define debug_decs(data) do { if (debug_enable) print_decs(data); } while (0) #define debug_hex4(data) do { if (debug_enable) print_hex4(data); } while (0) @@ -46,11 +45,35 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #define debug_bin_reverse8(data) do { if (debug_enable) print_bin_reverse8(data); } while (0) #define debug_bin_reverse16(data) do { if (debug_enable) print_bin_reverse16(data); } while (0) #define debug_bin_reverse32(data) do { if (debug_enable) print_bin_reverse32(data); } while (0) - #define debug_hex(data) debug_hex8(data) #define debug_bin(data) debug_bin8(data) #define debug_bin_reverse(data) debug_bin8(data) +#else + +#define debug(s) +#define debugln(s) +#define debug_S(s) +#define debug_P(s) +#define debug_msg(s) +#define debug_dec(data) +#define debug_decs(data) +#define debug_hex4(data) +#define debug_hex8(data) +#define debug_hex16(data) +#define debug_hex32(data) +#define debug_bin8(data) +#define debug_bin16(data) +#define debug_bin32(data) +#define debug_bin_reverse8(data) +#define debug_bin_reverse16(data) +#define debug_bin_reverse32(data) +#define debug_hex(data) +#define debug_bin(data) +#define debug_bin_reverse(data) + +#endif + #ifdef __cplusplus extern "C" { |