From: Erik M. <er...@us...> - 2001-10-15 21:27:08
|
Update of /cvsroot/blob/blob/src/lib In directory usw-pr-cvs1:/tmp/cvs-serv13231/src/lib Modified Files: led.c Log Message: - add led_lock(), led_unlock(), and led_init() functions - use led_init() in init calls - remove led_off() from exit calls (so pleb will remain working) Index: led.c =================================================================== RCS file: /cvsroot/blob/blob/src/lib/led.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- led.c 2001/10/14 20:24:32 1.4 +++ led.c 2001/10/15 21:27:05 1.5 @@ -48,12 +48,25 @@ static int led_state; +static int led_locked; + + + + +void led_init(void) +{ + led_unlock(); + led_on(); +} void led_on(void) { + if(led_locked) + return; + GPSR = LED_GPIO; led_state = 1; } @@ -63,6 +76,9 @@ void led_off(void) { + if(led_locked) + return; + GPCR = LED_GPIO; led_state = 0; } @@ -76,4 +92,20 @@ led_off(); else led_on(); +} + + + + +void led_lock(void) +{ + led_locked = 1; +} + + + + +void led_unlock(void) +{ + led_locked = 0; } |