]> git.llucax.com Git - z.facultad/66.09/etherled.git/blob - src/leds.h
ea8c0837135f176e7bb955cff7046876be007e8e
[z.facultad/66.09/etherled.git] / src / leds.h
1 // vim: set et sw=4 sts=4 :     
2
3 #ifndef _LEDS_H_
4 #define _LEDS_H_
5
6 #include "types.h"
7
8 #ifdef SDCC
9 static xdata at 0x0080 byte leds0;
10 static xdata at 0x00c0 byte leds1;
11 #else
12 static byte xdata leds0 _at_ 0x0080;
13 static byte xdata leds1 _at_ 0x00c0;
14 #endif
15
16 #define leds(word)          \
17     do                      \
18     {                       \
19         uint16 w = word;    \
20         leds0 = ~LOW(w);    \
21         leds1 = ~HIGH(w);   \
22     }                       \
23     while (0)
24
25 #define ledsb(bh, bl)   \
26     do                  \
27     {                   \
28         leds0 = ~(bl);  \
29         leds1 = ~(bh);  \
30     }                   \
31     while (0)
32
33 #endif // _LEDS_H_