48
48
#ifndef __DEBUG_H__
49
49
#define __DEBUG_H__
50
50
51
- #ifdef __cplusplus
52
- extern "C" {
53
- #endif
54
-
55
51
/* Includes ------------------------------------------------------------------*/
56
52
#include <string.h>
57
- #include <stdio.h>
58
- #include "hw_conf.h"
59
- #include "timeServer.h"
53
+ //#include <stdio.h>
60
54
#include "utilities.h"
61
55
62
56
/* Exported types ------------------------------------------------------------*/
@@ -72,73 +66,36 @@ typedef enum LOG_LEVEL_E {
72
66
LL_ALL
73
67
} LOG_LEVEL ;
74
68
75
- #ifdef CONFIG_DEBUG_LINKWAN
76
- extern LOG_LEVEL g_log_level ;
77
- #define ERR_PRINTF (format , ...) do { \
78
- if(g_log_level>=LL_ERR) { \
79
- TimerTime_t ts = TimerGetCurrentTime(); \
80
- printf("[%llu]", ts); \
81
- printf(format, ##__VA_ARGS__); \
82
- } \
83
- }while(0)
84
-
85
- #define WARN_PRINTF (format , ...) do { \
86
- if(g_log_level>=LL_WARN) { \
87
- TimerTime_t ts = TimerGetCurrentTime(); \
88
- printf("[%llu]", ts); \
89
- printf(format, ##__VA_ARGS__); \
90
- } \
91
- }while(0)
92
-
93
- #define DBG_PRINTF (format , ...) do { \
94
- if(g_log_level>=LL_DEBUG) { \
95
- TimerTime_t ts = TimerGetCurrentTime(); \
96
- printf("[%llu]", ts); \
97
- printf(format, ##__VA_ARGS__); \
98
- } \
99
- }while(0)
100
-
101
- #define VDBG_PRINTF (format , ...) do { \
102
- if(g_log_level>=LL_VDEBUG) { \
103
- TimerTime_t ts = TimerGetCurrentTime(); \
104
- printf("[%llu]", ts); \
105
- printf(format, ##__VA_ARGS__); \
106
- } \
107
- }while(0)
108
-
109
- #define PRINTF_RAW (...) do { \
110
- if(g_log_level>=LL_DEBUG) printf(__VA_ARGS__); \
111
- }while(0)
112
-
113
- #define PRINTF_AT (...) printf(__VA_ARGS__)
114
-
115
- #define DBG_PRINTF_CRITICAL (p )
116
- #else
117
- #define ERR_PRINTF (format , ...) do {}while(0)
118
- #define WARN_PRINTF (format , ...) do {}while(0)
119
- #define DBG_PRINTF (format , ...) do {}while(0)
120
- #define VDBG_PRINTF (format , ...) do {}while(0)
121
- #define PRINTF_RAW (...)
122
- #define PRINTF_AT (...) printf(__VA_ARGS__)
123
- #define DBG_PRINTF_CRITICAL (p )
124
- #endif
125
69
70
+ #ifdef __cplusplus
71
+ extern "C" {
72
+ #endif
126
73
127
- /* Exported functions ------------------------------------------------------- */
128
-
129
- /**
130
- * @brief Initializes the debug
131
- * @param None
132
- * @retval None
133
- */
134
- void DBG_Init (void );
135
- int DBG_LogLevelGet ();
136
- void DBG_LogLevelSet (int level );
137
74
138
75
#ifdef __cplusplus
139
76
}
140
77
#endif
141
78
79
+
80
+ #define ERR_PRINTF (format , ...) do {}while(0)
81
+ #define WARN_PRINTF (format , ...) do {}while(0)
82
+ #define VDBG_PRINTF (format , ...) do {}while(0)
83
+ #define PRINTF_RAW (...)
84
+ #define PRINTF_AT (...)
85
+ #define DBG_PRINTF_CRITICAL (p )
86
+ #define DBG_PRINTF (format , ...) do {}while(0)
87
+
88
+ #if LoRaWAN_DEBUG_LEVEL >= 2
89
+ #define FREQ_PRINTF (format , ...) printf(format, ##__VA_ARGS__)
90
+ #define DIO_PRINTF (format , ...) printf(format, ##__VA_ARGS__)
91
+ #elif LoRaWAN_DEBUG_LEVEL == 1
92
+ #define FREQ_PRINTF (format , ...) printf(format, ##__VA_ARGS__)
93
+ #define DIO_PRINTF (format , ...)
94
+ #else
95
+ #define FREQ_PRINTF (format , ...) do {}while(0)
96
+ #define DIO_PRINTF (format , ...) do {}while(0)
97
+ #endif
98
+
142
99
#endif /* __DEBUG_H__*/
143
100
144
101
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
0 commit comments