35 #include "sys/clock.h"
38 static unsigned char leds, invert;
41 show_leds(
unsigned char changed)
43 if(changed & LEDS_GREEN) {
45 if((invert ^ leds) & LEDS_GREEN) {
46 ENERGEST_ON(ENERGEST_TYPE_LED_GREEN);
48 ENERGEST_OFF(ENERGEST_TYPE_LED_GREEN);
51 if(changed & LEDS_YELLOW) {
52 if((invert ^ leds) & LEDS_YELLOW) {
53 ENERGEST_ON(ENERGEST_TYPE_LED_YELLOW);
55 ENERGEST_OFF(ENERGEST_TYPE_LED_YELLOW);
58 if(changed & LEDS_RED) {
59 if((invert ^ leds) & LEDS_RED) {
60 ENERGEST_ON(ENERGEST_TYPE_LED_RED);
62 ENERGEST_OFF(ENERGEST_TYPE_LED_RED);
65 leds_arch_set(leds ^ invert);
80 inv = ~(leds ^ invert);
90 return leds_arch_get();
94 leds_on(
unsigned char ledv)
96 unsigned char changed;
97 changed = (~leds) & ledv;
103 leds_off(
unsigned char ledv)
105 unsigned char changed;
106 changed = leds & ledv;
112 leds_toggle(
unsigned char ledv)
119 leds_invert(
unsigned char ledv) {
120 invert = invert ^ ledv;