From a4c610942d7f41937c87b8ce076f89670bd61e82 Mon Sep 17 00:00:00 2001 From: Robin Jones Date: Fri, 27 Oct 2017 17:08:13 +0100 Subject: [PATCH] further corrections to debug #16 source was not building when debug was not defined. --- inc/debug.h | 7 ++++--- src/debug.c | 8 ++++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/inc/debug.h b/inc/debug.h index 4f24e20..07512b5 100644 --- a/inc/debug.h +++ b/inc/debug.h @@ -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 diff --git a/src/debug.c b/src/debug.c index 97a6b59..dba46cc 100644 --- a/src/debug.c +++ b/src/debug.c @@ -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); } \ No newline at end of file