diff options
-rw-r--r-- | openpicc/application/led.c | 22 | ||||
-rw-r--r-- | openpicc/application/led.h | 2 |
2 files changed, 23 insertions, 1 deletions
diff --git a/openpicc/application/led.c b/openpicc/application/led.c index c414e92..6defff6 100644 --- a/openpicc/application/led.c +++ b/openpicc/application/led.c @@ -29,6 +29,8 @@ #include "led.h" /**********************************************************************/ +#define BLINK_TIME 10 + void vLedSetRed(bool_t on) { if(on) @@ -38,7 +40,16 @@ void vLedSetRed(bool_t on) } /**********************************************************************/ -extern void vLedSetGreen(bool_t on) +void vLedBlinkRed(void) +{ + volatile int i=0; + vLedSetRed(1); + for(i=0; i<BLINK_TIME; i++) (void)i; + vLedSetRed(0); +} +/**********************************************************************/ + +void vLedSetGreen(bool_t on) { if(on) AT91F_PIO_ClearOutput( AT91C_BASE_PIOA, LED_GREEN ); @@ -47,6 +58,15 @@ extern void vLedSetGreen(bool_t on) } /**********************************************************************/ +void vLedBlinkGreen(void) +{ + volatile int i=0; + vLedSetGreen(1); + for(i=0; i<BLINK_TIME; i++) (void)i; + vLedSetGreen(0); +} +/**********************************************************************/ + void vLedHaltBlinking(int reason) { volatile u_int32_t i=0; diff --git a/openpicc/application/led.h b/openpicc/application/led.h index 83a6138..56699be 100644 --- a/openpicc/application/led.h +++ b/openpicc/application/led.h @@ -26,7 +26,9 @@ #include "openpicc.h" extern void vLedSetRed(bool_t on); +extern void vLedBlinkRed(void); extern void vLedSetGreen(bool_t on); +extern void vLedBlinkGreen(void); extern void vLedHaltBlinking(int reason); extern void vLedInit(void); |