osd-contiki/platform/avr-rss2/dev/leds.c
Robert Olsson 3829dd2f20 Leds toggle added
modified:   platform/avr-rss2/dev/leds.c
2017-03-24 17:37:37 +01:00

51 lines
741 B
C

#include <avr/pgmspace.h>
#include "rss2.h"
#include "leds.h"
void
leds_init(void)
{
DDRE |= (1 << LED_RED);
DDRE |= (1 << LED_YELLOW);
/* Off */
leds_off(LEDS_ALL);
}
void
leds_on(unsigned char ledv)
{
if(ledv & LEDS_YELLOW) {
PORTE &= ~(1 << LED_YELLOW);
}
if(ledv & LEDS_RED) {
PORTE &= ~(1 << LED_RED);
}
}
void
leds_off(unsigned char ledv)
{
if(ledv & LEDS_YELLOW) {
PORTE |= (1 << LED_YELLOW);
}
if(ledv & LEDS_RED) {
PORTE |= (1 << LED_RED);
}
}
void
leds_toggle(unsigned char ledv)
{
if(ledv & LEDS_YELLOW) {
PORTE ^= (1 << LED_YELLOW);
}
if(ledv & LEDS_RED) {
PORTE ^= (1 << LED_RED);
}
}
void
leds_invert(unsigned char ledv)
{
}
unsigned char
leds_get(void)
{
return 0;
}