@@ -32,42 +32,42 @@ Maintainer: Michael Coracin
32
32
#include "py/mpprint.h"
33
33
34
34
// debug levels
35
- #define DEBUG 4
36
- #define INFO_ 3
37
- #define WARN_ 2
38
- #define ERROR 1
35
+ #define LORAPF_DEBUG 4
36
+ #define LORAPF_INFO_ 3
37
+ #define LORAPF_WARN_ 2
38
+ #define LORAPF_ERROR 1
39
39
40
40
// run time debug level
41
41
extern int debug_level ;
42
42
// compile time debug level
43
- #define DEBUG_LEVEL INFO_
43
+ #define LORAPF_DEBUG_LEVEL LORAPF_INFO_
44
44
45
45
#define MSG_DX (LEVEL , fmt , ...) \
46
46
do { \
47
47
if (debug_level >= LEVEL) \
48
- mp_printf(&mp_plat_print, "[%u] lorapf: " #LEVEL " " fmt, mp_hal_ticks_ms(), ##__VA_ARGS__); \
48
+ mp_printf(&mp_plat_print, "[%u] " #LEVEL ": " fmt, mp_hal_ticks_ms(), ##__VA_ARGS__); \
49
49
} while (0)
50
50
51
- #if DEBUG_LEVEL >= DEBUG
52
- #define MSG_DEBUG (...) MSG_DX(DEBUG , __VA_ARGS__)
51
+ #if LORAPF_DEBUG_LEVEL >= LORAPF_DEBUG
52
+ #define MSG_DEBUG (...) MSG_DX(LORAPF_DEBUG , __VA_ARGS__)
53
53
#else
54
54
#define MSG_DEBUG (...) (void)0
55
55
#endif
56
56
57
- #if DEBUG_LEVEL >= INFO_
58
- #define MSG_INFO (...) MSG_DX(INFO_ , __VA_ARGS__)
57
+ #if LORAPF_DEBUG_LEVEL >= LORAPF_INFO_
58
+ #define MSG_INFO (...) MSG_DX(LORAPF_INFO_ , __VA_ARGS__)
59
59
#else
60
60
#define MSG_INFO (...) (void)0
61
61
#endif
62
62
63
- #if DEBUG_LEVEL >= WARN_
64
- #define MSG_WARN (...) MSG_DX(WARN_ , __VA_ARGS__)
63
+ #if LORAPF_DEBUG_LEVEL >= LORAPF_WARN_
64
+ #define MSG_WARN (...) MSG_DX(LORAPF_WARN_ , __VA_ARGS__)
65
65
#else
66
66
#define MSG_WARN (...) (void)0
67
67
#endif
68
68
69
- #if DEBUG_LEVEL >= ERROR
70
- #define MSG_ERROR (...) MSG_DX(ERROR , __VA_ARGS__)
69
+ #if LORAPF_DEBUG_LEVEL >= LORAPF_ERROR
70
+ #define MSG_ERROR (...) MSG_DX(LORAPF_ERROR , __VA_ARGS__)
71
71
#else
72
72
#define MSG_ERROR (...) (void)0
73
73
#endif
0 commit comments