166 #if !defined(SERPORT_DEBUG_CREATE_OWN_CIRBUFS)
173 #if !defined(DEBUG_LEVEL_OFF)
174 #define DEBUG_LEVEL_OFF 0
177 #if !defined(DEBUG_LEVEL_CRITICAL)
178 #define DEBUG_LEVEL_CRITICAL 1
181 #if !defined(DEBUG_LEVEL_ERROR)
182 #define DEBUG_LEVEL_ERROR 2
185 #if !defined(DEBUG_LEVEL_WARNING)
186 #define DEBUG_LEVEL_WARNING 3
189 #if !defined(DEBUG_LEVEL_INFO)
190 #define DEBUG_LEVEL_INFO 4
193 #if !defined(DEBUG_LEVEL_FINE)
194 #define DEBUG_LEVEL_FINE 5
197 #if !defined(DEBUG_TEMP_BUF_SIZE)
198 #define DEBUG_TEMP_BUF_SIZE 128
207 #if !defined(DEBUG_TXBUF_SIZE)
208 #define DEBUG_TXBUF_SIZE 256
217 #if !defined(DEBUG_RXBUF_SIZE)
218 #define DEBUG_RXBUF_SIZE 32
229 extern char debugTempBuf[DEBUG_TEMP_BUF_SIZE];
233 #if defined(SERPORT_DEBUG_CREATE_OWN_CIRBUFS)
234 #if !defined(CIRBUF_TX_DEBUG)
235 extern CIRBUF cbufTxDebug;
236 #define CIRBUF_TX_DEBUG (&cbufTxDebug)
239 #if !defined(CIRBUF_RX_DEBUG)
240 extern CIRBUF cbufRxDebug;
241 #define CIRBUF_RX_DEBUG (&cbufRxDebug)
245 #if !defined(DEBUG_ERROR_FLAGS_DEFINED)
246 typedef union __attribute__((aligned(2), packed)) {
250 unsigned long bSerPortMemAllocFail:1;
251 unsigned long bCirbufSizeError:1;
252 unsigned long bCirbufPacketFormatError:1;
253 unsigned long bDebugFlagsRes0_3:1;
254 unsigned long bDebugFlagsRes0_4:1;
255 unsigned long bDebugFlagsRes0_5:1;
256 unsigned long bDebugFlagsRes0_6:1;
257 unsigned long bDebugFlagsRes0_7:1;
259 unsigned long bDebugFlagsRes1_0:1;
260 unsigned long bDebugFlagsRes1_1:1;
261 unsigned long bDebugFlagsRes1_2:1;
262 unsigned long bDebugFlagsRes1_3:1;
263 unsigned long bDebugFlagsRes1_4:1;
264 unsigned long bDebugFlagsRes1_5:1;
265 unsigned long bDebugFlagsRes1_6:1;
266 unsigned long bDebugFlagsRes1_7:1;
279 #if defined(HAS_NZ_DEBUGGING)
289 void debugInit(
void);
295 #if defined(HAS_NZ_DEBUGGING)
299 void debugAllInitDone(
void);
301 #define debugAllInitDone()
305 #if defined(HAS_NZ_DEBUGGING)
309 void debugService(
void);
311 #define debugService()
315 #if defined(HAS_NZ_DEBUGGING)
322 void debugPutChar(CHAR c);
324 #define debugPutChar(c)
328 #if defined(HAS_NZ_DEBUGGING)
336 void debugPutByte(BYTE b);
338 #define debugPutByte(b)
342 #if defined(HAS_NZ_DEBUGGING)
350 void debugPutWord(WORD w);
352 #define debugPutWord(w)
356 #if defined(HAS_NZ_DEBUGGING)
364 void debugPutArray(
const BYTE* pArr, WORD size);
366 #define debugPutArray(pArr, size)
370 #if defined(HAS_NZ_DEBUGGING)
377 void debugPutString(
const char * str);
379 #define debugPutString(str)
383 #if defined(HAS_NZ_DEBUGGING)
389 void debugPutHexByte(BYTE b);
391 #define debugPutHexByte(w)
395 #if defined(HAS_NZ_DEBUGGING)
401 void debugPutHexWord(WORD w);
403 #define debugPutHexWord(w)
408 #if defined(HAS_NZ_DEBUGGING)
417 void debugPutHexLine(DWORD adr, BYTE* buf, BYTE len);
419 #define debugPutHexLine(adr, buf, len)
423 #if defined(HAS_NZ_DEBUGGING)
428 void debugWaitForSpace(BYTE required);
430 #define debugWaitForSpace(required)
434 #if defined(HAS_NZ_DEBUGGING)
438 void debugWaitTillAllSent(
void);
440 #define debugWaitTillAllSent()
444 #if defined(HAS_NZ_DEBUGGING)
449 BOOL debugIsTxBufEmpty(
void);
451 #define debugIsTxBufEmpty() (1)
461 #if !defined(DEBUG_PUT_STR)
462 #define DEBUG_PUT_STR(lvl, str) {if (MY_DEBUG_LEVEL >= lvl) {debugPutString(str);}}
472 #if !defined(DEBUG_PUT_CHAR)
473 #define DEBUG_PUT_CHAR(lvl, c) {if (MY_DEBUG_LEVEL >= lvl) {debugPutChar(c);}}
484 #if !defined(DEBUG_PUT_BYTE)
485 #define DEBUG_PUT_BYTE(lvl, c) {if (MY_DEBUG_LEVEL >= lvl) {debugPutByte(c);}}
496 #if !defined(DEBUG_PUT_WORD)
497 #define DEBUG_PUT_WORD(lvl, w) {if (MY_DEBUG_LEVEL >= lvl) {debugPutWord(w);}}
509 #if !defined(DEBUG_PUT_HEXBYTE)
510 #define DEBUG_PUT_HEXBYTE(lvl, b) {if (MY_DEBUG_LEVEL >= lvl) {debugPutHexByte(b);}}
522 #if !defined(DEBUG_PUT_HEXWORD)
523 #define DEBUG_PUT_HEXWORD(lvl, w) {if (MY_DEBUG_LEVEL >= lvl) {debugPutHexWord(w);}}