X-Git-Url: https://git.llucax.com/z.facultad/66.09/etherled.git/blobdiff_plain/05000dec2685a88aaf9bd3c20c8861e62c94696c..ed08c9be17a0893215918932492380f758c60afa:/src/leds.h diff --git a/src/leds.h b/src/leds.h index 26c2cb3..ea8c083 100644 --- a/src/leds.h +++ b/src/leds.h @@ -13,12 +13,21 @@ static byte xdata leds0 _at_ 0x0080; static byte xdata leds1 _at_ 0x00c0; #endif -#define leds(word) \ - do \ - { \ - leds0 = ~LOW(word); \ - leds1 = ~HIGH(word); \ - } \ +#define leds(word) \ + do \ + { \ + uint16 w = word; \ + leds0 = ~LOW(w); \ + leds1 = ~HIGH(w); \ + } \ + while (0) + +#define ledsb(bh, bl) \ + do \ + { \ + leds0 = ~(bl); \ + leds1 = ~(bh); \ + } \ while (0) #endif // _LEDS_H_