mirror of
git://projects.qi-hardware.com/ben-blinkenlights.git
synced 2024-11-05 08:49:43 +02:00
ubb-la/gui.c (DEBUG): make debugging fprintfs optional via DEBUG macro
This commit is contained in:
parent
2d49a73aad
commit
533e9643ac
15
ubb-la/gui.c
15
ubb-la/gui.c
@ -19,6 +19,13 @@
|
||||
#include "gui.h"
|
||||
|
||||
|
||||
#if 0
|
||||
#define DEBUG(fmt, ...) fprintf(stderr, fmt, __VA_ARGS__)
|
||||
#else
|
||||
#define DEBUG(fmt, ...)
|
||||
#endif
|
||||
|
||||
|
||||
#define XRES 320 /* canvas width */
|
||||
#define YRES 240 /* canvas height */
|
||||
|
||||
@ -98,8 +105,8 @@ static void show_buffer_zoom_in(const uint8_t *buf, int skip, int nibbles,
|
||||
int last[4] = { -1, -1, -1, -1};
|
||||
uint8_t v, bit;
|
||||
|
||||
fprintf(stderr, "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));
|
||||
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));
|
||||
x = x0;
|
||||
for (i = skip; i != nibbles; i++) {
|
||||
v = (buf[i >> 1] >> 4*(~i & 1)) & 0xf;
|
||||
@ -127,8 +134,8 @@ 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];
|
||||
uint8_t v, bit;
|
||||
|
||||
fprintf(stderr, "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));
|
||||
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));
|
||||
for (x = x0; x != x1; x++) {
|
||||
n = i+f;
|
||||
for (j = 0; j != 4; j++) {
|
||||
|
Loading…
Reference in New Issue
Block a user