X-Git-Url: https://git.friedersdorff.com/?a=blobdiff_plain;f=print.c;h=59b4bca1800f85576d01ad5004fc1b6cf63c7cd2;hb=45d4a7a89883c3433604d4e011b665796a583008;hp=5395fa3480227a3a7724fd7a1c901bce402ca168;hpb=d3b1af9572e123c939fc355474bf12402c86d292;p=max%2Ftmk_keyboard.git diff --git a/print.c b/print.c index 5395fa34..59b4bca1 100644 --- a/print.c +++ b/print.c @@ -27,8 +27,12 @@ #include #include "print.h" + +bool print_enable = false; + void print_P(const char *s) { + if (!print_enable) return; char c; while (1) { @@ -41,17 +45,20 @@ void print_P(const char *s) void phex1(unsigned char c) { + if (!print_enable) return; usb_debug_putchar(c + ((c < 10) ? '0' : 'A' - 10)); } void phex(unsigned char c) { + if (!print_enable) return; phex1(c >> 4); phex1(c & 15); } void phex16(unsigned int i) { + if (!print_enable) return; phex(i >> 8); phex(i); } @@ -59,6 +66,7 @@ void phex16(unsigned int i) void pbin(unsigned char c) { + if (!print_enable) return; for (int i = 7; i >= 0; i--) { usb_debug_putchar((c & (1<