42 DDRE |= LEDS_CONF_GREEN | LEDS_CONF_YELLOW;
43 PORTE |= LEDS_CONF_GREEN | LEDS_CONF_YELLOW;
45 DDRB |= LEDS_CONF_ORANGE | LEDS_CONF_GREEN;
46 DDRE |= LEDS_CONF_RED | LEDS_CONF_YELLOW;
48 PORTB &= ~(LEDS_CONF_ORANGE | LEDS_CONF_GREEN);
49 PORTE &= ~(LEDS_CONF_RED | LEDS_CONF_YELLOW);
54 leds_on(
unsigned char leds)
57 if (leds & LEDS_GREEN)
58 PORTE &= ~LEDS_CONF_GREEN;
59 if (leds & LEDS_YELLOW)
60 PORTE &= ~LEDS_CONF_YELLOW;
62 if (leds & LEDS_ORANGE)
63 PORTB |= LEDS_CONF_ORANGE;
64 if (leds & LEDS_GREEN)
65 PORTB |= LEDS_CONF_GREEN;
68 PORTE |= LEDS_CONF_RED;
69 if (leds & LEDS_YELLOW)
70 PORTE |= LEDS_CONF_YELLOW;
75 leds_off(
unsigned char leds)
78 if (leds & LEDS_GREEN)
79 PORTE |= LEDS_CONF_GREEN;
80 if (leds & LEDS_YELLOW)
81 PORTE |= LEDS_CONF_YELLOW;
83 if (leds & LEDS_ORANGE)
84 PORTB &= ~LEDS_CONF_ORANGE;
85 if (leds & LEDS_GREEN)
86 PORTB &= ~LEDS_CONF_GREEN;
89 PORTE &= ~LEDS_CONF_RED;
90 if (leds & LEDS_YELLOW)
91 PORTE &= ~LEDS_CONF_YELLOW;
96 leds_toggle(
unsigned char leds)
101 asm(
".global leds_invert\nleds_invert:\n");
104 if (leds & LEDS_GREEN)
105 PORTE ^= ~LEDS_CONF_GREEN;
106 if (leds & LEDS_YELLOW)
107 PORTE ^= ~LEDS_CONF_YELLOW;
109 if (leds & LEDS_ORANGE)
110 PORTB ^= LEDS_CONF_ORANGE;
111 if (leds & LEDS_GREEN)
112 PORTB ^= LEDS_CONF_GREEN;
115 PORTE ^= LEDS_CONF_RED;
116 if (leds & LEDS_YELLOW)
117 PORTE ^= LEDS_CONF_YELLOW;