summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2007-02-18 05:07:19 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2007-02-18 05:07:19 +0000
commitbd47d48c21ddcdd56b3654db78613d93739b8ce7 (patch)
tree78ddd13c384995b4220adc2c85eff233956420d2 /firmware
parentac61951452e001da48430d8487521ad32b7a123c (diff)
downloadrockbox-bd47d48c21ddcdd56b3654db78613d93739b8ce7.zip
rockbox-bd47d48c21ddcdd56b3654db78613d93739b8ce7.tar.gz
rockbox-bd47d48c21ddcdd56b3654db78613d93739b8ce7.tar.bz2
rockbox-bd47d48c21ddcdd56b3654db78613d93739b8ce7.tar.xz
Do the CONFIG_LED define
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12383 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/drivers/ata.c6
-rw-r--r--firmware/drivers/led.c5
-rw-r--r--firmware/export/ata.h2
-rw-r--r--firmware/export/config.h4
-rw-r--r--firmware/panic.c4
5 files changed, 12 insertions, 9 deletions
diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c
index c3c2531..54a1b12 100644
--- a/firmware/drivers/ata.c
+++ b/firmware/drivers/ata.c
@@ -71,7 +71,7 @@ static struct mutex ata_mtx;
int ata_device; /* device 0 (master) or 1 (slave) */
int ata_spinup_time = 0;
-#if defined(CONFIG_LED) && (CONFIG_LED == LED_REAL)
+#if (CONFIG_LED == LED_REAL)
static bool ata_led_enabled = true;
static bool ata_led_on = false;
#endif
@@ -152,7 +152,7 @@ STATICIRAM int wait_for_end_of_transfer(void)
return (ATA_ALT_STATUS & (STATUS_RDY|STATUS_DRQ)) == STATUS_RDY;
}
-#if defined(CONFIG_LED) && (CONFIG_LED == LED_REAL)
+#if (CONFIG_LED == LED_REAL)
/* Conditionally block LED access for the ATA driver, so the LED can be
* (mis)used for other purposes */
static void ata_led(bool on)
@@ -1003,7 +1003,7 @@ int ata_init(void)
return 0;
}
-#if defined(CONFIG_LED) && (CONFIG_LED == LED_REAL)
+#if (CONFIG_LED == LED_REAL)
void ata_set_led_enabled(bool enabled)
{
ata_led_enabled = enabled;
diff --git a/firmware/drivers/led.c b/firmware/drivers/led.c
index 2799b7c..36748a1 100644
--- a/firmware/drivers/led.c
+++ b/firmware/drivers/led.c
@@ -23,7 +23,7 @@
#include "system.h"
#include "kernel.h"
-#if (defined(CONFIG_LED) && (CONFIG_LED == LED_REAL))
+#if (CONFIG_LED == LED_REAL)
void led(bool on)
{
@@ -37,8 +37,7 @@ void led(bool on)
}
}
-#elif (defined(CONFIG_LED) && (CONFIG_LED == LED_VIRTUAL)) \
- || defined(HAVE_REMOTE_LCD)
+#elif (CONFIG_LED == LED_VIRTUAL) || defined(HAVE_REMOTE_LCD)
static bool current;
static long last_on; /* timestamp of switching off */
diff --git a/firmware/export/ata.h b/firmware/export/ata.h
index 697935c..d332330 100644
--- a/firmware/export/ata.h
+++ b/firmware/export/ata.h
@@ -47,7 +47,7 @@ extern int ata_init(void);
extern int ata_read_sectors(IF_MV2(int drive,) unsigned long start, int count, void* buf);
extern int ata_write_sectors(IF_MV2(int drive,) unsigned long start, int count, const void* buf);
extern void ata_spin(void);
-#if defined(CONFIG_LED) && (CONFIG_LED == LED_REAL)
+#if (CONFIG_LED == LED_REAL)
extern void ata_set_led_enabled(bool enabled);
#endif
extern unsigned short* ata_get_identify(void);
diff --git a/firmware/export/config.h b/firmware/export/config.h
index aaaac68..0a59c0b 100644
--- a/firmware/export/config.h
+++ b/firmware/export/config.h
@@ -226,6 +226,10 @@
#define CONFIG_USBOTG 0
#endif
+#ifndef CONFIG_LED
+#define CONFIG_LED 0
+#endif
+
/* Enable the directory cache and tagcache in RAM if we have
* plenty of RAM. Both features can be enabled independently. */
#if ((defined(MEMORYSIZE) && (MEMORYSIZE > 8)) || MEM > 8) && \
diff --git a/firmware/panic.c b/firmware/panic.c
index 8d6b0e5..c50bd54 100644
--- a/firmware/panic.c
+++ b/firmware/panic.c
@@ -39,7 +39,7 @@ void panicf( const char *fmt, ...)
va_list ap;
#ifndef SIMULATOR
-#if (defined(CONFIG_LED) && (CONFIG_LED == LED_REAL))
+#if (CONFIG_LED == LED_REAL)
bool state = false;
int i = 0;
#endif
@@ -90,7 +90,7 @@ void panicf( const char *fmt, ...)
while (1)
{
#ifndef SIMULATOR
-#if (defined(CONFIG_LED) && (CONFIG_LED == LED_REAL))
+#if (CONFIG_LED == LED_REAL)
if (--i <= 0)
{
state = !state;