]> git.llucax.com Git - z.facultad/66.09/etherled.git/blob - src/debug.h
Integra leds con modulo de red. El programa está ahora recibiendo datos de la
[z.facultad/66.09/etherled.git] / src / debug.h
1 // vim: set et sw=4 sts=4 :     
2
3 #ifndef _DEBUG_H_
4 #define _DEBUG_H_
5
6 #ifdef DEBUG
7
8 #include "types.h"
9 #include "leds.h"
10
11 #define sleep(t)                        \
12     do                                  \
13     {                                   \
14         uint16 i;                       \
15         byte j;                         \
16         for (i = 0; i < 0xffff; ++i)    \
17             for (j = 0; j < t; ++j);    \
18     }                                   \
19     while (0)
20
21 #define print(w)        \
22     do                  \
23     {                   \
24         leds_write(w);  \
25         sleep(8);       \
26     }                   \
27     while (0)
28
29 #define printb(bh, bl)          \
30     do                          \
31     {                           \
32         leds_write_high(bh);    \
33         leds_write_low(bl);     \
34         sleep(8);               \
35     }                           \
36     while (0)
37
38 #else // NO DEBUG
39
40 #define sleep(t) ;
41 #define print(w) ;
42 #define printb(b1, b2) ;
43
44 #endif // DEBUG
45
46 #endif // _DEBUG_H_