1 #ifndef __DEBUG_H__ 2 #define __DEBUG_H__ 3 4 5 #define PCBA_VERSION 0x00010300 6 #define COPYRIGHT "PCBA V1.3.0 Copyright (C) 2012 Rockchip" 7 8 9 #define CMD_PIPE_NAME "/tmp/cmd_pipe" 10 #define VOLUME_PIPE_NAME "/tmp/volume_pipe" 11 #define CAMERA_PIPE_NAME "/tmp/camera_pipe" 12 13 #define TEST_COMPLETION "done" 14 15 #define DB_LOG_LEVEL 4 16 17 #if DB_LOG_LEVEL == 1 18 #define DB_ERROR 19 #elif DB_LOG_LEVEL == 2 20 #define DB_ERROR 21 #define DB_WARN 22 #elif DB_LOG_LEVEL == 3 23 #define DB_ERROR 24 #define DB_WARN 25 #define DB_MSG 26 #elif DB_LOG_LEVEL == 4 27 #define DB_ERROR 28 #define DB_WARN 29 #define DB_MSG 30 #define DB_DEBUG 31 #elif DB_LOG_LEVEL == 5 32 #define DB_ERROR 33 #define DB_WARN 34 #define DB_MSG 35 #define DB_DEBUG 36 #define DB_DUMP 37 #endif 38 39 #ifdef DB_ERROR 40 #define db_error(fmt, ...) \ 41 do { fprintf(stderr, "(error): "); fprintf(stderr, fmt, ##__VA_ARGS__); } while (0) 42 #else 43 #define db_error(fmt, ...) 44 #endif /* DB_ERROR */ 45 46 #ifdef DB_WARN 47 #define db_warn(fmt, ...) \ 48 do { fprintf(stdout, "(warn): "); fprintf(stdout, fmt, ##__VA_ARGS__); } while (0) 49 #else 50 #define db_warn(fmt, ...) 51 #endif /* DB_WARN */ 52 53 #ifdef DB_MSG 54 #define db_msg(fmt, ...) \ 55 do { fprintf(stdout, "(msg): "); fprintf(stdout, fmt, ##__VA_ARGS__); } while (0) 56 #else 57 #define db_msg(fmt, ...) 58 #endif /* DB_MSG */ 59 60 #ifdef DB_DEBUG 61 #define db_debug(fmt, ...) \ 62 do { fprintf(stdout, "(debug): "); fprintf(stdout, fmt, ##__VA_ARGS__); } while (0) 63 #else 64 #define db_debug(fmt, ...) 65 #endif /* DB_DEBUG */ 66 67 #ifdef DB_DUMP 68 #define db_dump(fmt, ...) \ 69 do { fprintf(stdout, "(dump): "); fprintf(stdout, fmt, ##__VA_ARGS__); } while (0) 70 #else 71 #define db_dump(fmt, ...) 72 #endif 73 74 #endif 75 76