Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

Commit

Permalink
further corrections to debug #16
Browse files Browse the repository at this point in the history
source was not building when debug was not defined.
  • Loading branch information
networkfusion committed Oct 27, 2017
1 parent d7e9fc5 commit a4c6109
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
7 changes: 4 additions & 3 deletions inc/debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 8 additions & 0 deletions src/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

0 comments on commit a4c6109

Please sign in to comment.