diff --git a/core/dev/leds.c b/core/dev/leds.c index a78fc7a75..f0d1e8fc5 100644 --- a/core/dev/leds.c +++ b/core/dev/leds.c @@ -121,7 +121,3 @@ leds_invert(unsigned char ledv) { show_leds(ledv); } /*---------------------------------------------------------------------------*/ -void leds_green(int o) { o?leds_on(LEDS_GREEN):leds_off(LEDS_GREEN); } -void leds_yellow(int o) { o?leds_on(LEDS_YELLOW):leds_off(LEDS_YELLOW); } -void leds_red(int o) { o?leds_on(LEDS_RED):leds_off(LEDS_RED); } -/*---------------------------------------------------------------------------*/ diff --git a/core/dev/leds.h b/core/dev/leds.h index 60f279d4c..dcb947e36 100644 --- a/core/dev/leds.h +++ b/core/dev/leds.h @@ -55,11 +55,18 @@ void leds_init(void); */ void leds_blink(void); +#ifndef LEDS_GREEN #define LEDS_GREEN 1 -#define LEDS_YELLOW 2 -#define LEDS_RED 4 -#define LEDS_BLUE LEDS_YELLOW /* Tmote Sky is colorblind? */ -#define leds_blue leds_yellow +#endif /* LEDS_GREEN */ +#ifndef LEDS_YELLOW +#define LEDS_YELLOW 2 +#endif /* LEDS_YELLOW */ +#ifndef LEDS_RED +#define LEDS_RED 4 +#endif /* LEDS_RED */ +#ifndef LEDS_BLUE +#define LEDS_BLUE LEDS_YELLOW +#endif /* LEDS_BLUE */ #ifdef LEDS_CONF_ALL #define LEDS_ALL LEDS_CONF_ALL @@ -76,18 +83,6 @@ void leds_off(unsigned char leds); void leds_toggle(unsigned char leds); void leds_invert(unsigned char leds); - - - -void leds_green(int onoroff); -void leds_red(int onoroff); -void leds_yellow(int onoroff); -#define LEDS_ON 1 -#define LEDS_OFF 0 - - - - /** * Leds implementation */ diff --git a/cpu/msp430/loader-arch.c b/cpu/msp430/loader-arch.c index 224d8d28b..b05166101 100644 --- a/cpu/msp430/loader-arch.c +++ b/cpu/msp430/loader-arch.c @@ -111,7 +111,7 @@ loader_arch_load(unsigned short startaddr) /* If the checksum was wrong, we beep. The number of beeps indicate the numerival value of the calculated checksum. */ if(sum != 0xff) { - leds_red(LEDS_ON); + leds_on(LEDS_RED); for(i = 0; i < (sum >> 4); ++i) { beep_beep(200); @@ -131,23 +131,23 @@ loader_arch_load(unsigned short startaddr) } } - leds_red(LEDS_OFF); + leds_off(LEDS_RED); return; } else { - leds_green(LEDS_ON); + leds_on(LEDS_GREEN); for(i = 0; i < 4; ++i) { beep_beep(200); for(j = 0; j < 2; ++j) { clock_delay(60000); } } - leds_green(LEDS_OFF); + leds_off(LEDS_GREEN); } - leds_yellow(LEDS_ON); + leds_on(LEDS_YELLOW); startaddr += 2; /* Read the size of the code segment from the next two bytes in EEPROM. */ @@ -185,9 +185,9 @@ loader_arch_load(unsigned short startaddr) flash_done(); - leds_yellow(LEDS_OFF); + leds_off(LEDS_YELLOW); - leds_green(LEDS_ON); + leds_on(LEDS_GREEN); /* Read the size of the code segment from the first two bytes in EEPROM. */ eeprom_read(startaddr + 2 + codelen, (char *)&datalen, 2); @@ -205,7 +205,7 @@ loader_arch_load(unsigned short startaddr) clock_delay(20000); } - leds_green(LEDS_OFF); + leds_off(LEDS_GREEN); /* Execute the loaded program. */ init = ((void (*)(void *))FLASHADDR); diff --git a/platform/esb/dev/ir.c b/platform/esb/dev/ir.c index 042d60155..3c1d4313d 100644 --- a/platform/esb/dev/ir.c +++ b/platform/esb/dev/ir.c @@ -251,7 +251,7 @@ interrupt(TIMERB1_VECTOR) Timer_B1 (void) { // reenable interrupt for falling edge P1IFG &= ~(0x04); P1IE |= 0x04; // enable interrupt for recir RC5 - leds_red(LEDS_OFF); + leds_off(LEDS_RED); } ir_pos++; @@ -280,7 +280,7 @@ ir_irq(void) TBCCTL1 |= CCIE; // CCR0 interrupt enabled, interrupt occurs when timer equals CCR0 P1IE &= ~0x04; // disable interrupt for P12 ( ReceiveIR ) - leds_red(LEDS_ON); + leds_on(LEDS_RED); //GREENON; } diff --git a/platform/netsim/contiki-main.c b/platform/netsim/contiki-main.c index acf283e15..6600a8570 100644 --- a/platform/netsim/contiki-main.c +++ b/platform/netsim/contiki-main.c @@ -159,7 +159,7 @@ contiki_main(int flag) uip_fw_default(&meshif); } - leds_green(LEDS_ON); + leds_on(LEDS_GREEN); rtimer_init();