summaryrefslogtreecommitdiff
path: root/common/print.c
diff options
context:
space:
mode:
authortmk <nobody@nowhere>2013-03-19 14:08:40 +0900
committertmk <nobody@nowhere>2013-03-19 14:08:40 +0900
commit9a106537f64fe61af6048b41262f002ce6a716d9 (patch)
tree9df736d957945b5d3377b8cb5005946acd99bd61 /common/print.c
parent8580c8d291a432d5004c46321aa3c1b1626cdadd (diff)
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/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