aboutsummaryrefslogtreecommitdiff
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)
downloadqmk_firmware-9a106537f64fe61af6048b41262f002ce6a716d9.tar.gz
qmk_firmware-9a106537f64fe61af6048b41262f002ce6a716d9.zip
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 08d211f20..329f83512 100644
--- a/common/print.c
+++ b/common/print.c
@@ -27,12 +27,17 @@
27#include "print.h" 27#include "print.h"
28 28
29 29
30#define sendchar(c) do { if (print_enable && print_sendchar_func) (print_sendchar_func)(c); } while (0) 30#ifndef NO_PRINT
31 31
32#define sendchar(c) do { if (print_sendchar_func) (print_sendchar_func)(c); } while (0)
32 33
33int8_t (*print_sendchar_func)(uint8_t) = 0;
34bool print_enable = true;
35 34
35static int8_t (*print_sendchar_func)(uint8_t) = 0;
36
37void print_set_sendchar(int8_t (*sendchar_func)(uint8_t))
38{
39 print_sendchar_func = sendchar_func;
40}
36 41
37/* print string stored in data memory(SRAM) 42/* print string stored in data memory(SRAM)
38 * print_P("hello world"); 43 * print_P("hello world");
@@ -184,3 +189,5 @@ void print_bin_reverse32(uint32_t data)
184 print_bin_reverse8(data>>16); 189 print_bin_reverse8(data>>16);
185 print_bin_reverse8(data>>24); 190 print_bin_reverse8(data>>24);
186} 191}
192
193#endif