|
24 | 24 | #define DEBUG_EVENT 1
|
25 | 25 |
|
26 | 26 | #if (DEBUG > 3)
|
27 |
| -#define USB_DBG(x, ...) std::printf("[USB_DBG: %s:%d]" x "\r\n", __FILE__, __LINE__, ##__VA_ARGS__); |
| 27 | +#define USB_DBG(x, ...) if (rtos::ThisThread::get_id() != 0) { printf("[USB_DBG: %s:%d]" x "\r\n", __FILE__, __LINE__, ##__VA_ARGS__); } |
28 | 28 | #else
|
29 | 29 | #define USB_DBG(x, ...)
|
30 | 30 | #endif
|
31 | 31 |
|
32 | 32 | #if (DEBUG > 2)
|
33 |
| -#define USB_INFO(x, ...) std::printf("[USB_INFO: %s:%d]" x "\r\n", __FILE__, __LINE__, ##__VA_ARGS__); |
| 33 | +#define USB_INFO(x, ...) if (rtos::ThisThread::get_id() != 0) { printf("[USB_INFO: %s:%d]" x "\r\n", __FILE__, __LINE__, ##__VA_ARGS__); } |
34 | 34 | #else
|
35 | 35 | #define USB_INFO(x, ...)
|
36 | 36 | #endif
|
37 | 37 |
|
38 | 38 | #if (DEBUG > 1)
|
39 |
| -#define USB_WARN(x, ...) std::printf("[USB_WARNING: %s:%d]" x "\r\n", __FILE__, __LINE__, ##__VA_ARGS__); |
| 39 | +#define USB_WARN(x, ...) if (rtos::ThisThread::get_id() != 0) { printf("[USB_WARNING: %s:%d]" x "\r\n", __FILE__, __LINE__, ##__VA_ARGS__); } |
40 | 40 | #else
|
41 | 41 | #define USB_WARN(x, ...)
|
42 | 42 | #endif
|
43 | 43 |
|
44 | 44 | #if (DEBUG > 0)
|
45 |
| -#define USB_ERR(x, ...) std::printf("[USB_ERR: %s:%d]" x "\r\n", __FILE__, __LINE__, ##__VA_ARGS__); |
| 45 | +#define USB_ERR(x, ...) if (rtos::ThisThread::get_id() != 0) { printf("[USB_ERR: %s:%d]" x "\r\n", __FILE__, __LINE__, ##__VA_ARGS__); } |
46 | 46 | #else
|
47 | 47 | #define USB_ERR(x, ...)
|
48 | 48 | #endif
|
49 | 49 |
|
50 | 50 | #if (DEBUG_TRANSFER)
|
51 |
| -#define USB_DBG_TRANSFER(x, ...) std::printf("[USB_TRANSFER: %s:%d]" x "\r\n", __FILE__, __LINE__, ##__VA_ARGS__); |
| 51 | +#define USB_DBG_TRANSFER(x, ...) if (rtos::ThisThread::get_id() != 0) { printf("[USB_TRANSFER: %s:%d]" x "\r\n", __FILE__, __LINE__, ##__VA_ARGS__); } |
52 | 52 | #else
|
53 | 53 | #define USB_DBG_TRANSFER(x, ...)
|
54 | 54 | #endif
|
55 | 55 |
|
56 | 56 | #if (DEBUG_EVENT)
|
57 |
| -#define USB_DBG_EVENT(x, ...) std::printf("[USB_EVENT: %s:%d]" x "\r\n", __FILE__, __LINE__, ##__VA_ARGS__); |
| 57 | +#define USB_DBG_EVENT(x, ...) if (rtos::ThisThread::get_id() != 0) { std::printf("[USB_EVENT: %s:%d]" x "\r\n", __FILE__, __LINE__, ##__VA_ARGS__); } |
58 | 58 | #else
|
59 | 59 | #define USB_DBG_EVENT(x, ...)
|
60 | 60 | #endif
|
|
0 commit comments