#define DRV_DEBUG
#ifdef DRV_DEBUG
#define DRV_PRINT(fmt, ...) printf(fmt, __VA_ARGS__)
#else
#define DRV_PRINT(fmt, ...)
#endif
-------------------------------------------------------------------
#define DRV_DEBUG 1
#define DRV_DEBUG_IN 0x0001
#define DRV_DEBUG_OUT 0x0002
#define DRV_DEBUG_ERR 0x0004
#define DRV_DEBUG_ALL 0xFFFF
#if DRV_DEBUG
unsigned int drv_flags = DRV_DEBUG_ERR | DRV_DEBUG_OUT;
#define DRV_PRINT(flag, fmt, ...) \
do{\
if(drv_flags & flag){\
printf(fmt, __VA_ARGS__)}\
}while(0)
#else
#define DRV_PRINT(fmt, ...)
#endif