X-Git-Url: https://git.friedersdorff.com/?a=blobdiff_plain;ds=sidebyside;f=common%2Fdebug.h;h=8aaa5ed915e2b62a9ada6ff3b9e6b628cc21122c;hb=77e946432e22382ad1bae8da05af87611006efab;hp=e16ea14af4053786b23cbbb0b5f7042f0bdf4eeb;hpb=2b08a150a41e25e87362436b7307bb1be35529f3;p=max%2Ftmk_keyboard.git
diff --git a/common/debug.h b/common/debug.h
index e16ea14a..8aaa5ed9 100644
--- a/common/debug.h
+++ b/common/debug.h
@@ -18,14 +18,20 @@ along with this program. If not, see .
#ifndef DEBUG_H
#define DEBUG_H 1
-#include
#include "print.h"
+#include "debug_config.h"
#ifndef NO_DEBUG
+#define dprint(s) do { if (debug_enable) print(s); } while (0)
+#define dprintln() do { if (debug_enable) print_crlf(); } while (0)
+#define dprintf(fmt, ...) do { if (debug_enable) __xprintf(PSTR(fmt), ##__VA_ARGS__); } while (0)
+#define dmsg(s) dprintf("%s at %s: %S\n", __FILE__, __LINE__, PSTR(s))
+
+/* DO NOT USE these anymore */
#define debug(s) do { if (debug_enable) print(s); } while (0)
-#define debugln(s) do { if (debug_enable) println(s); } while (0)
+#define debugln(s) do { if (debug_enable) print_crlf(); } while (0)
#define debug_S(s) do { if (debug_enable) print_S(s); } while (0)
#define debug_P(s) do { if (debug_enable) print_P(s); } while (0)
#define debug_msg(s) do { \
@@ -50,42 +56,7 @@ along with this program. If not, see .
#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" {
-#endif
-
-extern bool debug_enable;
-extern bool debug_matrix;
-extern bool debug_keyboard;
-extern bool debug_mouse;
-
-#ifdef __cplusplus
-}
+#include "nodebug.h"
#endif
#endif