80#define SOFTPACK_VERSION "1.5"
83#define TRACE_LEVEL_DEBUG 5
84#define TRACE_LEVEL_INFO 4
85#define TRACE_LEVEL_WARNING 3
86#define TRACE_LEVEL_ERROR 2
87#define TRACE_LEVEL_FATAL 1
88#define TRACE_LEVEL_NO_TRACE 0
91#if !defined(TRACE_LEVEL)
92 #define TRACE_LEVEL TRACE_LEVEL_INFO
96#if !defined(DYN_TRACES)
101 #error "Error: NOTRACE has to be not defined !"
106 #if (TRACE_LEVEL == TRACE_LEVEL_NO_TRACE)
118extern void TRACE_CONFIGURE(uint32_t dwBaudRate, uint32_t dwMCk);
131#if (TRACE_LEVEL==0) && (DYNTRACE==0)
132#define TRACE_CONFIGURE_ISP(mode, baudrate, mck) {}
134#define TRACE_CONFIGURE_ISP(mode, baudrate, mck) { \
135 const Pin pinsUART0[] = {PINS_UART}; \
136 PIO_Configure(pinsUART0, PIO_LISTSIZE(pinsUART0)); \
137 UART_Configure(baudrate, mck); \
149 #define TRACE_DEBUG(...) { }
150 #define TRACE_INFO(...) { }
151 #define TRACE_WARNING(...) { }
152 #define TRACE_ERROR(...) { }
153 #define TRACE_FATAL(...) { while (1); }
155 #define TRACE_DEBUG_WP(...) { }
156 #define TRACE_INFO_WP(...) { }
157 #define TRACE_WARNING_WP(...) { }
158 #define TRACE_ERROR_WP(...) { }
159 #define TRACE_FATAL_WP(...) { while (1); }
161#elif (DYN_TRACES == 1)
164 #define TRACE_DEBUG(...) { if (dwTraceLevel >= TRACE_LEVEL_DEBUG) { printf("-D- " __VA_ARGS__); } }
165 #define TRACE_INFO(...) { if (dwTraceLevel >= TRACE_LEVEL_INFO) { printf("-I- " __VA_ARGS__); } }
166 #define TRACE_WARNING(...) { if (dwTraceLevel >= TRACE_LEVEL_WARNING) { printf("-W- " __VA_ARGS__); } }
167 #define TRACE_ERROR(...) { if (dwTraceLevel >= TRACE_LEVEL_ERROR) { printf("-E- " __VA_ARGS__); } }
168 #define TRACE_FATAL(...) { if (dwTraceLevel >= TRACE_LEVEL_FATAL) { printf("-F- " __VA_ARGS__); while (1); } }
170 #define TRACE_DEBUG_WP(...) { if (dwTraceLevel >= TRACE_LEVEL_DEBUG) { printf(__VA_ARGS__); } }
171 #define TRACE_INFO_WP(...) { if (dwTraceLevel >= TRACE_LEVEL_INFO) { printf(__VA_ARGS__); } }
172 #define TRACE_WARNING_WP(...) { if (dwTraceLevel >= TRACE_LEVEL_WARNING) { printf(__VA_ARGS__); } }
173 #define TRACE_ERROR_WP(...) { if (dwTraceLevel >= TRACE_LEVEL_ERROR) { printf(__VA_ARGS__); } }
174 #define TRACE_FATAL_WP(...) { if (dwTraceLevel >= TRACE_LEVEL_FATAL) { printf(__VA_ARGS__); while (1); } }
179 #if (TRACE_LEVEL >= TRACE_LEVEL_DEBUG)
180 #define TRACE_DEBUG(...) { printf("-D- " __VA_ARGS__); }
181 #define TRACE_DEBUG_WP(...) { printf(__VA_ARGS__); }
183 #define TRACE_DEBUG(...) { }
184 #define TRACE_DEBUG_WP(...) { }
187 #if (TRACE_LEVEL >= TRACE_LEVEL_INFO)
188 #define TRACE_INFO(...) { printf("-I- " __VA_ARGS__); }
189 #define TRACE_INFO_WP(...) { printf(__VA_ARGS__); }
191 #define TRACE_INFO(...) { }
192 #define TRACE_INFO_WP(...) { }
195 #if (TRACE_LEVEL >= TRACE_LEVEL_WARNING)
196 #define TRACE_WARNING(...) { printf("-W- " __VA_ARGS__); }
197 #define TRACE_WARNING_WP(...) { printf(__VA_ARGS__); }
199 #define TRACE_WARNING(...) { }
200 #define TRACE_WARNING_WP(...) { }
203 #if (TRACE_LEVEL >= TRACE_LEVEL_ERROR)
204 #define TRACE_ERROR(...) { printf("-E- " __VA_ARGS__); }
205 #define TRACE_ERROR_WP(...) { printf(__VA_ARGS__); }
207 #define TRACE_ERROR(...) { }
208 #define TRACE_ERROR_WP(...) { }
211 #if (TRACE_LEVEL >= TRACE_LEVEL_FATAL)
212 #define TRACE_FATAL(...) { printf("-F- " __VA_ARGS__); while (1); }
213 #define TRACE_FATAL_WP(...) { printf(__VA_ARGS__); while (1); }
215 #define TRACE_FATAL(...) { while (1); }
216 #define TRACE_FATAL_WP(...) { while (1); }
226#if !defined(NOTRACE) && (DYN_TRACES == 1)
227 extern uint32_t dwTraceLevel;