X-Git-Url: http://git.rot13.org//?p=goodfet;a=blobdiff_plain;f=firmware%2Flib%2Fmsp430.c;fp=firmware%2Flib%2Fmsp430.c;h=0f30e33650ab1fb091adf748d7d40b84113aabbb;hp=19bca37df3aadaedc45ccaf1538fe8533a179f57;hb=dd49731422f391ad8cfbc1910b9b5285f36f43bc;hpb=a5b5dc2e02ec49f9fc9164e0e5cd70b18e48f635;ds=sidebyside diff --git a/firmware/lib/msp430.c b/firmware/lib/msp430.c index 19bca37..0f30e33 100644 --- a/firmware/lib/msp430.c +++ b/firmware/lib/msp430.c @@ -16,8 +16,15 @@ void led_init() { PLEDDIR |= PLEDPIN; + #ifdef PLED2OUT + PLED2DIR |= PLED2PIN; + #endif + #ifdef PLED3OUT + PLED3DIR |= PLED3PIN; + #endif } +//TODO define differently if needed for telos/apimote void led_on() { PLEDOUT |= PLEDPIN; @@ -31,6 +38,24 @@ void led_toggle() PLEDOUT ^= PLEDPIN; } +//LED2 and LED3 are only used by the telosb and apimote for now +void led2_on() +{ + PLED2OUT &= ~PLED2PIN; +} +void led2_off() +{ + PLED2OUT |= PLED2PIN; +} +void led3_on() +{ + PLED3OUT &= ~PLED3PIN; +} +void led3_off() +{ + PLED3OUT |= PLED3PIN; +} + //! Initialize MSP430 registers and all that jazz. void msp430_init(){ WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer @@ -39,7 +64,6 @@ void msp430_init(){ led_init(); led_off(); - /* P5.0 out and low; this is chosen for the PIC app (in which P5.0 is !MCLR) to ensure that an attached PIC chip, if present, is immediately driven to reset state. A brief explanation of why this