From 5690f78fb23ec66aeadf5ecf8200b5610b3e59d2 Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Sat, 4 Jun 2005 23:15:52 +0000 Subject: Multiple choice LED configuration instead of HAVE_LED. Removes erroneous MMC icon display on iriver, and saves some code on Ondio. Removed invert_led() as it is no longer used. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6568 a1c6a512-1295-4272-9138-f99709370657 --- firmware/drivers/led.c | 32 +++++--------------------------- 1 file changed, 5 insertions(+), 27 deletions(-) (limited to 'firmware/drivers/led.c') diff --git a/firmware/drivers/led.c b/firmware/drivers/led.c index 4598175b79..ca4aadac71 100644 --- a/firmware/drivers/led.c +++ b/firmware/drivers/led.c @@ -23,16 +23,11 @@ #include "system.h" #include "kernel.h" -static bool current; - -#ifdef HAVE_LED - -static bool xor; +#if CONFIG_LED == LED_REAL void led(bool on) { - current = on; - if ( on ^ xor ) + if ( on ) #ifdef GMINI_ARCH P2 |= 1; else @@ -48,21 +43,9 @@ void led(bool on) #endif } -void invert_led(bool on) -{ - if ( on ) - { - xor = 1; - } - else - { - xor = 0; - } - led(current); -} - -#else /* no LED, just status update */ +#elif CONFIG_LED == LED_VIRTUAL +static bool current; static long last_on; /* timestamp of switching off */ void led(bool on) @@ -74,15 +57,10 @@ void led(bool on) current = on; } -void invert_led(bool on) -{ - (void)on; /* no invert feature */ -} - bool led_read(int delayticks) /* read by status bar update */ { /* reading "off" is delayed by user-supplied monoflop value */ return (current || TIME_BEFORE(current_tick, last_on+delayticks)); } -#endif // #ifdef HAVE_LED +#endif /* CONFIG_LED */ -- cgit v1.2.3