diff options
| author | Jens Arnold <amiconn@rockbox.org> | 2005-06-04 23:15:52 +0000 |
|---|---|---|
| committer | Jens Arnold <amiconn@rockbox.org> | 2005-06-04 23:15:52 +0000 |
| commit | 5690f78fb23ec66aeadf5ecf8200b5610b3e59d2 (patch) | |
| tree | 62bab156602ab905851fbb000c22d48bf2f8f85e /firmware/drivers | |
| parent | c9cc73ec1988dae9e3d1a09347ceac2a4ecc1f67 (diff) | |
| download | rockbox-5690f78fb23ec66aeadf5ecf8200b5610b3e59d2.zip rockbox-5690f78fb23ec66aeadf5ecf8200b5610b3e59d2.tar.gz rockbox-5690f78fb23ec66aeadf5ecf8200b5610b3e59d2.tar.bz2 rockbox-5690f78fb23ec66aeadf5ecf8200b5610b3e59d2.tar.xz | |
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
Diffstat (limited to 'firmware/drivers')
| -rw-r--r-- | firmware/drivers/ata.c | 8 | ||||
| -rw-r--r-- | firmware/drivers/led.c | 32 |
2 files changed, 13 insertions, 27 deletions
diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c index c8ad3b3..9bf1815 100644 --- a/firmware/drivers/ata.c +++ b/firmware/drivers/ata.c @@ -241,8 +241,10 @@ static volatile unsigned char* ata_control; bool old_recorder = false; int ata_spinup_time = 0; +#ifdef CONFIG_LED static bool ata_led_enabled = true; static bool ata_led_on = false; +#endif static bool spinup = false; static bool sleeping = true; static long sleep_timeout = 5*HZ; @@ -475,12 +477,16 @@ static void copy_read_sectors(unsigned char* buf, int wordcount) #endif } +#ifdef CONFIG_LED static void ata_led(bool on) { ata_led_on = on; if (ata_led_enabled) { led(ata_led_on); } } +#else +#define ata_led(on) +#endif int ata_read_sectors(IF_MV2(int drive,) unsigned long start, @@ -1468,6 +1474,7 @@ int ata_init(void) return 0; } +#if CONFIG_LED == LED_REAL void ata_set_led_enabled(bool enabled) { ata_led_enabled = enabled; if (ata_led_enabled) { @@ -1476,3 +1483,4 @@ void ata_set_led_enabled(bool enabled) { led(false); } } +#endif diff --git a/firmware/drivers/led.c b/firmware/drivers/led.c index 4598175..ca4aada 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 */ |