1
0
mirror of git://projects.qi-hardware.com/ben-blinkenlights.git synced 2024-11-27 16:17:12 +02:00

ubb-la/gui.c (DEBUG): make debugging fprintfs optional via DEBUG macro

This commit is contained in:
Werner Almesberger 2013-01-30 21:25:47 -03:00
parent 2d49a73aad
commit 533e9643ac

View File

@ -19,6 +19,13 @@
#include "gui.h" #include "gui.h"
#if 0
#define DEBUG(fmt, ...) fprintf(stderr, fmt, __VA_ARGS__)
#else
#define DEBUG(fmt, ...)
#endif
#define XRES 320 /* canvas width */ #define XRES 320 /* canvas width */
#define YRES 240 /* canvas height */ #define YRES 240 /* canvas height */
@ -98,7 +105,7 @@ static void show_buffer_zoom_in(const uint8_t *buf, int skip, int nibbles,
int last[4] = { -1, -1, -1, -1}; int last[4] = { -1, -1, -1, -1};
uint8_t v, bit; uint8_t v, bit;
fprintf(stderr, "in: %d-%d (%d) Sa %d-%d (%d) pix %d f (%d)\n", DEBUG("in: %d-%d (%d) Sa %d-%d (%d) pix %d f (%d)\n",
skip, nibbles, nibbles-skip, x0, x1, x1-x0, f, f*(nibbles-skip)); skip, nibbles, nibbles-skip, x0, x1, x1-x0, f, f*(nibbles-skip));
x = x0; x = x0;
for (i = skip; i != nibbles; i++) { for (i = skip; i != nibbles; i++) {
@ -127,7 +134,7 @@ static void show_buffer_zoom_out(const uint8_t *buf, int skip, int nibbles,
int changes[4], last[4] = { -1, -1, -1, -1}, next[4]; int changes[4], last[4] = { -1, -1, -1, -1}, next[4];
uint8_t v, bit; uint8_t v, bit;
fprintf(stderr, "out: %d-%d (%d) Sa %d-%d (%d) pix %d f (%d)\n", DEBUG("out: %d-%d (%d) Sa %d-%d (%d) pix %d f (%d)\n",
skip, nibbles, nibbles-skip, x0, x1, x1-x0, f, f*(x1-x0)); skip, nibbles, nibbles-skip, x0, x1, x1-x0, f, f*(x1-x0));
for (x = x0; x != x1; x++) { for (x = x0; x != x1; x++) {
n = i+f; n = i+f;