]> git.gir.st - tmk_keyboard.git/blob - common/debug.h
Documentation: small mistake
[tmk_keyboard.git] / common / debug.h
1 /*
2 Copyright 2011 Jun Wako <wakojun@gmail.com>
3
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 2 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18 #ifndef DEBUG_H
19 #define DEBUG_H 1
20
21 #include "print.h"
22 #include "debug_config.h"
23
24
25 #ifndef NO_DEBUG
26
27 #define dprint(s) do { if (debug_enable) print(s); } while (0)
28 #define dprintln() do { if (debug_enable) print_crlf(); } while (0)
29 #define dprintf(fmt, ...) do { if (debug_enable) __xprintf(PSTR(fmt), ##__VA_ARGS__); } while (0)
30 #define dmsg(s) dprintf("%s at %s: %S\n", __FILE__, __LINE__, PSTR(s))
31
32 /* DO NOT USE these anymore */
33 #define debug(s) do { if (debug_enable) print(s); } while (0)
34 #define debugln(s) do { if (debug_enable) print_crlf(); } while (0)
35 #define debug_S(s) do { if (debug_enable) print_S(s); } while (0)
36 #define debug_P(s) do { if (debug_enable) print_P(s); } while (0)
37 #define debug_msg(s) do { \
38 if (debug_enable) { \
39 print(__FILE__); print(" at "); print_dec(__LINE__); print(" in "); print(": "); print(s); \
40 } \
41 } while (0)
42 #define debug_dec(data) do { if (debug_enable) print_dec(data); } while (0)
43 #define debug_decs(data) do { if (debug_enable) print_decs(data); } while (0)
44 #define debug_hex4(data) do { if (debug_enable) print_hex4(data); } while (0)
45 #define debug_hex8(data) do { if (debug_enable) print_hex8(data); } while (0)
46 #define debug_hex16(data) do { if (debug_enable) print_hex16(data); } while (0)
47 #define debug_hex32(data) do { if (debug_enable) print_hex32(data); } while (0)
48 #define debug_bin8(data) do { if (debug_enable) print_bin8(data); } while (0)
49 #define debug_bin16(data) do { if (debug_enable) print_bin16(data); } while (0)
50 #define debug_bin32(data) do { if (debug_enable) print_bin32(data); } while (0)
51 #define debug_bin_reverse8(data) do { if (debug_enable) print_bin_reverse8(data); } while (0)
52 #define debug_bin_reverse16(data) do { if (debug_enable) print_bin_reverse16(data); } while (0)
53 #define debug_bin_reverse32(data) do { if (debug_enable) print_bin_reverse32(data); } while (0)
54 #define debug_hex(data) debug_hex8(data)
55 #define debug_bin(data) debug_bin8(data)
56 #define debug_bin_reverse(data) debug_bin8(data)
57
58 #else
59 #include "nodebug.h"
60 #endif
61
62 #endif
Imprint / Impressum