summaryrefslogtreecommitdiff
path: root/quantum/logging/print.h
diff options
context:
space:
mode:
Diffstat (limited to 'quantum/logging/print.h')
-rw-r--r--quantum/logging/print.h36
1 files changed, 13 insertions, 23 deletions
diff --git a/quantum/logging/print.h b/quantum/logging/print.h
index 4c4195de50..984bc10758 100644
--- a/quantum/logging/print.h
+++ b/quantum/logging/print.h
@@ -52,40 +52,27 @@ void print_set_sendchar(sendchar_func_t func);
# if __has_include_next("_print.h")
# include_next "_print.h" /* Include the platforms print.h */
# else
-// Fall back to lib/printf
-# include "printf.h" // lib/printf/printf.h
-
-// Create user & normal print defines
-# define print(s) printf(s)
-# define println(s) printf(s "\r\n")
+# include "printf.h" // // Fall back to lib/printf/printf.h
# define xprintf printf
-# define uprint(s) printf(s)
-# define uprintln(s) printf(s "\r\n")
-# define uprintf printf
-
-# endif /* __has_include_next("_print.h") */
-#else /* NO_PRINT */
-# undef xprintf
+# endif
+#else
// Remove print defines
-# define print(s)
-# define println(s)
+# undef xprintf
# define xprintf(fmt, ...)
-# define uprintf(fmt, ...)
-# define uprint(s)
-# define uprintln(s)
+#endif
-#endif /* NO_PRINT */
+// Resolve before USER_PRINT can remove
+#define uprintf xprintf
#ifdef USER_PRINT
// Remove normal print defines
-# undef print
-# undef println
# undef xprintf
-# define print(s)
-# define println(s)
# define xprintf(fmt, ...)
#endif
+#define print(s) xprintf(s)
+#define println(s) xprintf(s "\r\n")
+
#define print_dec(i) xprintf("%u", i)
#define print_decs(i) xprintf("%d", i)
/* hex */
@@ -121,6 +108,9 @@ void print_set_sendchar(sendchar_func_t func);
//
// !!! DO NOT USE USER PRINT CALLS IN THE BODY OF QMK/TMK !!!
+#define uprint(s) uprintf(s)
+#define uprintln(s) uprintf(s "\r\n")
+
/* decimal */
#define uprint_dec(i) uprintf("%u", i)
#define uprint_decs(i) uprintf("%d", i)