WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
载入中...
搜索中...
未找到
dfx_print.h
浏览该文件的文档.
1/*
2 * Copyright (c) HiSilicon (Shanghai) Technologies Co., Ltd. 2024-2024. All rights reserved.
3 * Description: dfx print header file
4 */
5
6#ifndef DFX_PRINT_H
7#define DFX_PRINT_H
8
9#ifdef CONFIG_DFX_SUPPORT_PRINT
10#include <stdint.h>
11#include "debug_print.h"
12#endif
13
20
21#ifdef CONFIG_DFX_SUPPORT_PRINT
22
23uint8_t dfx_print_get_level(void);
24void dfx_print_set_level(uint8_t level);
25
26#define dfx_print_info(fmt, args...) do { \
27 if (dfx_print_get_level() <= DFX_PRINT_LEVEL_INFO) { \
28 PRINT(fmt, ##args); \
29 } \
30 } while (0)
31
32#define dfx_print_warn(fmt, args...) do { \
33 if (dfx_print_get_level() <= DFX_PRINT_LEVEL_WARN) { \
34 PRINT(fmt, ##args); \
35 } \
36 } while (0)
37
38#define dfx_print_error(fmt, args...) do { \
39 if (dfx_print_get_level() <= DFX_PRINT_LEVEL_ERROR) { \
40 PRINT(fmt, ##args); \
41 } \
42 } while (0)
43
44#define dfx_print(level, fmt, args...) do { \
45 if (dfx_print_get_level() <= level) { \
46 PRINT(fmt, ##args); \
47 } \
48 } while (0)
49#else
50
51#define dfx_print_info(fmt, args...) PRINT(fmt, ##args)
52#define dfx_print_warn(fmt, args...) PRINT(fmt, ##args)
53#define dfx_print_error(fmt, args...) PRINT(fmt, ##args)
54#define dfx_print(level, fmt, args...) PRINT(fmt, ##args)
55
56#endif
57#endif /* DFX_PRINT_H */
dfx_print_level
Definition dfx_print.h:14
@ DFX_PRINT_LEVEL_ERROR
Definition dfx_print.h:17
@ DFX_PRINT_LEVEL_INFO
Definition dfx_print.h:15
@ DFX_PRINT_LEVEL_WARN
Definition dfx_print.h:16
@ DFX_PRINT_LEVEL_MAX
Definition dfx_print.h:18