]> git.gir.st - tmk_keyboard.git/blob - tmk_core/tool/mbed/mbed-sdk/libraries/USBHost/USBHost/dbg.h
Merge commit '1fe4406f374291ab2e86e95a97341fd9c475fcb8'
[tmk_keyboard.git] / tmk_core / tool / mbed / mbed-sdk / libraries / USBHost / USBHost / dbg.h
1 /* mbed USBHost Library
2 * Copyright (c) 2006-2013 ARM Limited
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 #ifndef USB_DEBUG_H
18 #define USB_DEBUG_H
19
20 //Debug is disabled by default
21 #define DEBUG 3 /*INFO,ERR,WARN*/
22 #define DEBUG_TRANSFER 0
23 #define DEBUG_EP_STATE 0
24 #define DEBUG_EVENT 0
25
26 #if (DEBUG > 3)
27 #define USB_DBG(x, ...) std::printf("[USB_DBG: %s:%d]" x "\r\n", __FILE__, __LINE__, ##__VA_ARGS__);
28 #else
29 #define USB_DBG(x, ...)
30 #endif
31
32 #if (DEBUG > 2)
33 #define USB_INFO(x, ...) std::printf("[USB_INFO: %s:%d]" x "\r\n", __FILE__, __LINE__, ##__VA_ARGS__);
34 #else
35 #define USB_INFO(x, ...)
36 #endif
37
38 #if (DEBUG > 1)
39 #define USB_WARN(x, ...) std::printf("[USB_WARNING: %s:%d]" x "\r\n", __FILE__, __LINE__, ##__VA_ARGS__);
40 #else
41 #define USB_WARN(x, ...)
42 #endif
43
44 #if (DEBUG > 0)
45 #define USB_ERR(x, ...) std::printf("[USB_ERR: %s:%d]" x "\r\n", __FILE__, __LINE__, ##__VA_ARGS__);
46 #else
47 #define USB_ERR(x, ...)
48 #endif
49
50 #if (DEBUG_TRANSFER)
51 #define USB_DBG_TRANSFER(x, ...) std::printf("[USB_TRANSFER: %s:%d]" x "\r\n", __FILE__, __LINE__, ##__VA_ARGS__);
52 #else
53 #define USB_DBG_TRANSFER(x, ...)
54 #endif
55
56 #if (DEBUG_EVENT)
57 #define USB_DBG_EVENT(x, ...) std::printf("[USB_EVENT: %s:%d]" x "\r\n", __FILE__, __LINE__, ##__VA_ARGS__);
58 #else
59 #define USB_DBG_EVENT(x, ...)
60 #endif
61
62
63 #endif
64
65
66
Imprint / Impressum