Soldered SD Card Arduino Library 1.0.0
Easily read and write files to and form the SD card breakout! A fork of the original SDFat library by Bill Greiman.
Loading...
Searching...
No Matches
DebugMacros.h
Go to the documentation of this file.
1
25#ifndef DebugMacros_h
26#define DebugMacros_h
27#include "../SdFatConfig.h"
28#define USE_DBG_MACROS 0
29
30#if USE_DBG_MACROS
31#include "Arduino.h"
32#ifndef DBG_FILE
33#error DBG_FILE not defined
34#endif // DBG_FILE
35static void dbgPrint(uint16_t line)
36{
37 Serial.print(F("DBG_FAIL: "));
38 Serial.print(F(DBG_FILE));
39 Serial.write('.');
40 Serial.println(line);
41}
42
43#define DBG_PRINT_IF(b) \
44 if (b) \
45 { \
46 Serial.print(F(__FILE__)); \
47 Serial.println(__LINE__); \
48 }
49#define DBG_HALT_IF(b) \
50 if (b) \
51 { \
52 Serial.print(F("DBG_HALT ")); \
53 Serial.print(F(__FILE__)); \
54 Serial.println(__LINE__); \
55 while (true) \
56 { \
57 } \
58 }
59#define DBG_FAIL_MACRO dbgPrint(__LINE__);
60#else // USE_DBG_MACROS
61#define DBG_FAIL_MACRO
62#define DBG_PRINT_IF(b)
63#define DBG_HALT_IF(b)
64#endif // USE_DBG_MACROS
65#endif // DebugMacros_h
static void dbgPrint(uint16_t line)
Definition DebugMacros.h:35