diff options
author | henryk <henryk@6dc7ffe9-61d6-0310-9af1-9938baff3ed1> | 2007-11-16 07:58:36 +0000 |
---|---|---|
committer | henryk <henryk@6dc7ffe9-61d6-0310-9af1-9938baff3ed1> | 2007-11-16 07:58:36 +0000 |
commit | 3973ad39af7d6ddf6475425178a9b2b2b71f7fd1 (patch) | |
tree | 700409a1b15692017c22e5672233f4e743e5c599 /openpicc/application | |
parent | 8dc345999942b1f213f54c2ce4f2878abdabac4a (diff) |
Add blink functions (debugging help with oscilloscope)
git-svn-id: https://svn.openpcd.org:2342/trunk@328 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
Diffstat (limited to 'openpicc/application')
-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); |