增加DEBUG_TX调试日志
This commit is contained in:
parent
f29779995f
commit
d315d63d27
@ -82,3 +82,22 @@ int buffer_to_file(const char *pathname, const char *data, unsigned int size,con
|
|||||||
}
|
}
|
||||||
return temp;
|
return temp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 新增DEBUG_TX调试打印
|
||||||
|
int debug_tx_print(const char *format, ...)
|
||||||
|
{
|
||||||
|
if (access("/tmp/debug_tx_enable", F_OK) != 0) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
va_list valist;
|
||||||
|
char buffer[512] = "";
|
||||||
|
int ret;
|
||||||
|
va_start(valist, format);
|
||||||
|
ret = vsnprintf(buffer, sizeof(buffer), format, valist);
|
||||||
|
va_end(valist);
|
||||||
|
printf("[DEBUG_TX] %s", buffer);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
#define DEBUG_TX(fmt, ...) \
|
||||||
|
do { debug_tx_print(fmt, ##__VA_ARGS__); } while(0)
|
||||||
|
|||||||
@ -248,3 +248,13 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* _PRINTT_DBG_H_ */
|
#endif /* _PRINTT_DBG_H_ */
|
||||||
|
|
||||||
|
#ifndef DEBUG_PRINT_H
|
||||||
|
#define DEBUG_PRINT_H
|
||||||
|
|
||||||
|
int debug_tx_print(const char *format, ...);
|
||||||
|
|
||||||
|
#define DEBUG_TX(fmt, ...) \
|
||||||
|
do { debug_tx_print(fmt, ##__VA_ARGS__); } while(0)
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user