summaryrefslogtreecommitdiff
path: root/common/print.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/print.c')
-rw-r--r--common/print.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/common/print.c b/common/print.c
index 08d211f206..329f835125 100644
--- a/common/print.c
+++ b/common/print.c
@@ -27,12 +27,17 @@
#include "print.h"
-#define sendchar(c) do { if (print_enable && print_sendchar_func) (print_sendchar_func)(c); } while (0)
+#ifndef NO_PRINT
+#define sendchar(c) do { if (print_sendchar_func) (print_sendchar_func)(c); } while (0)
-int8_t (*print_sendchar_func)(uint8_t) = 0;
-bool print_enable = true;
+static int8_t (*print_sendchar_func)(uint8_t) = 0;
+
+void print_set_sendchar(int8_t (*sendchar_func)(uint8_t))
+{
+ print_sendchar_func = sendchar_func;
+}
/* print string stored in data memory(SRAM)
* print_P("hello world");
@@ -184,3 +189,5 @@ void print_bin_reverse32(uint32_t data)
print_bin_reverse8(data>>16);
print_bin_reverse8(data>>24);
}
+
+#endif