1 /* Global debug macros, variables, functions - header file */
9 #define usb_printf printf
11 int simple_printf(const char *f, ...);
12 #define usb_printf simple_printf
16 #define DEBUG_LEVEL_NONE 0
17 #define DEBUG_LEVEL_LOW 1
18 #define DEBUG_LEVEL_MEDIUM 2
19 #define DEBUG_LEVEL_HIGH 3
20 #define DEBUG_LEVEL_VERBOSE 4
22 #ifndef DEBUG_STATIC_LEVEL
23 /* Global static debug level */
24 #define DEBUG_STATIC_LEVEL DEBUG_LEVEL_NONE
27 /* If it is defined, current global debug level is
28 in 'global_debug_level' variable. Otherwise will
29 be used 'DEBUG_STATIC_LEVEL' as current global
32 /*#define DEBUG_USE_DYNAMIC_LEVEL*/
36 /*****************************************************************************/
37 /*****************************************************************************/
38 /*****************************************************************************/
42 /* use static or dynamic global debug level */
43 #if defined(DEBUG_USE_DYNAMIC_LEVEL) /* use dynamic debug level */
44 extern unsigned char usb_debug_level;
45 #else /* use only static debug level */
46 #define usb_debug_level DEBUG_STATIC_LEVEL
50 /* usb_debug_print( level, printargs) print debug info in printargs if
51 level is lower or equal to 'global_debug_level'/'DEBUG_STATIC_LEVEL'.
52 'printargs' is with parenthesis.
53 usage : usb_debug_print( DEBUG_LEVEL_MEDIUM,("i=%d",i));
55 #define usb_debug_print( _lvl_, _prnargs_) \
57 if ( usb_debug_level >= _lvl_) { \
58 usb_printf _prnargs_; \
62 /* usb_debug_info( printargs) print debug info always
63 usage : usb_debug_info( "debug info");
65 #define usb_debug_info usb_printf /* FIXME: this is not correct */
68 #define usb_debug_print( _lvl_, _prnargs_)
69 #define usb_debug_info(...)
73 void usb_debug_set_level(int level);
75 char *usb_debug_get_req_recipient( char rqt);
76 char *usb_debug_get_req_type( char rqt);
77 char *usb_debug_get_std_request( char req);
78 char *usb_debug_get_std_descriptor( unsigned char desc);
81 #endif /* _GLOBAL_DEBUG_H_ */