further corrections to debug #16

source was not building when debug was not defined.
This commit is contained in:
Robin Jones 2017-10-27 17:08:13 +01:00
parent d7e9fc5dbe
commit a4c610942d
2 changed files with 12 additions and 3 deletions

View File

@ -8,12 +8,13 @@
#ifdef DEBUG
#define TRACEF(disp, text, ...) dbg_printf(disp, text, __VA_ARGS__);
#define TRACE(disp, text) printText(text, 3, -1, disp);
#define TRACE(disp, text) dbg_print(disp, text);
#else
#define TRACEF(disp, text, ...) do { if (0) dbg_printf(disp, text, __VA_ARGS__); sleep(5000); } while (0)
#define TRACE(disp, text) do { if (0) printText(text, 3, -1, disp); } didplay_show(disp); sleep(5000); while (0)
#define TRACEF(disp, text, ...) do { if (0) dbg_printf(disp, text, __VA_ARGS__); } while (0)
#define TRACE(disp, text) do { if (0) dbg_print(disp, text); } while (0)
#endif
void dbg_printf(display_context_t disp, const char *fmt, ...);
void dbg_print(display_context_t disp, char *fmt);
#endif

View File

@ -21,4 +21,12 @@ void dbg_printf(display_context_t disp, const char *fmt, ...)
printText(tmp, 3, -1, disp);
display_show(disp);
sleep(3000);
}
void dbg_print(display_context_t disp, char *fmt)
{
printText(fmt, 3, -1, disp);
display_show(disp);
sleep(3000);
}