summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMagnus Holmgren <magnushol@gmail.com>2007-02-17 23:22:37 +0000
committerMagnus Holmgren <magnushol@gmail.com>2007-02-17 23:22:37 +0000
commit2067fcc695852a5589d6dded27cde77e20380179 (patch)
tree4face0c925a271b5cdf25ca743b428c1a049790a
parentd52ee4c0d6f1f63a57365dbf83a1d6dc0266fc5d (diff)
downloadrockbox-2067fcc695852a5589d6dded27cde77e20380179.tar.gz
rockbox-2067fcc695852a5589d6dded27cde77e20380179.tar.bz2
rockbox-2067fcc695852a5589d6dded27cde77e20380179.zip
Fix most (all?) CONFIG_LED warnings.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12370 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/gui/gwps-common.c2
-rw-r--r--apps/gui/statusbar.c8
-rw-r--r--apps/gui/statusbar.h2
-rw-r--r--apps/main.c2
-rw-r--r--apps/recorder/icons.h2
-rw-r--r--apps/recorder/recording.c14
-rw-r--r--apps/screen_access.c2
-rw-r--r--apps/screen_access.h2
-rw-r--r--firmware/drivers/ata.c6
-rw-r--r--firmware/export/ata.h2
10 files changed, 21 insertions, 21 deletions
diff --git a/apps/gui/gwps-common.c b/apps/gui/gwps-common.c
index d533e33f9c..4404776c7f 100644
--- a/apps/gui/gwps-common.c
+++ b/apps/gui/gwps-common.c
@@ -845,7 +845,7 @@ static char* get_tag(struct wps_data* wps_data,
}
break;
-#if (CONFIG_LED == LED_VIRTUAL) || defined(HAVE_REMOTE_LCD)
+#if (defined(CONFIG_LED) && (CONFIG_LED == LED_VIRTUAL)) || defined(HAVE_REMOTE_LCD)
case 'l': /* VIRTUAL_LED */
{
switch(tag[1])
diff --git a/apps/gui/statusbar.c b/apps/gui/statusbar.c
index f1bd58d70f..805b6a0ade 100644
--- a/apps/gui/statusbar.c
+++ b/apps/gui/statusbar.c
@@ -116,7 +116,7 @@
7*ICONS_SPACING
#define STATUSBAR_LOCKR_WIDTH 5
-#if (CONFIG_LED == LED_VIRTUAL) || defined(HAVE_REMOTE_LCD)
+#if (defined(CONFIG_LED) && (CONFIG_LED == LED_VIRTUAL)) || defined(HAVE_REMOTE_LCD)
#define STATUSBAR_DISK_WIDTH 12
#define STATUSBAR_DISK_X_POS(statusbar_width) statusbar_width - \
STATUSBAR_DISK_WIDTH
@@ -208,7 +208,7 @@ void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw)
bar->info.repeat = global_settings.repeat_mode;
bar->info.playmode = current_playmode();
-#if (CONFIG_LED == LED_VIRTUAL) || defined(HAVE_REMOTE_LCD)
+#if (defined(CONFIG_LED) && (CONFIG_LED == LED_VIRTUAL)) || defined(HAVE_REMOTE_LCD)
if(!display->has_disk_led)
bar->info.led = led_read(HZ/2); /* delay should match polling interval */
#endif
@@ -300,7 +300,7 @@ void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw)
#ifdef CONFIG_RTC
gui_statusbar_time(display, bar->info.hour, bar->info.minute);
#endif /* CONFIG_RTC */
-#if (CONFIG_LED == LED_VIRTUAL) || defined(HAVE_REMOTE_LCD)
+#if (defined(CONFIG_LED) && (CONFIG_LED == LED_VIRTUAL)) || defined(HAVE_REMOTE_LCD)
if(!display->has_disk_led && bar->info.led)
gui_statusbar_led(display);
#endif
@@ -541,7 +541,7 @@ void gui_statusbar_icon_lock_remote(struct screen * display)
}
#endif
-#if (CONFIG_LED == LED_VIRTUAL) || defined(HAVE_REMOTE_LCD)
+#if (defined(CONFIG_LED) && (CONFIG_LED == LED_VIRTUAL)) || defined(HAVE_REMOTE_LCD)
/*
* no real LED: disk activity in status bar
*/
diff --git a/apps/gui/statusbar.h b/apps/gui/statusbar.h
index 516598dd00..5190adc889 100644
--- a/apps/gui/statusbar.h
+++ b/apps/gui/statusbar.h
@@ -52,7 +52,7 @@ struct status_info {
#ifdef HAS_REMOTE_BUTTON_HOLD
bool keylockremote;
#endif
-#if (CONFIG_LED == LED_VIRTUAL) || defined(HAVE_REMOTE_LCD)
+#if (defined(CONFIG_LED) && (CONFIG_LED == LED_VIRTUAL)) || defined(HAVE_REMOTE_LCD)
bool led; /* disk LED simulation in the status bar */
#endif
diff --git a/apps/main.c b/apps/main.c
index 4c643c4130..6e49b51809 100644
--- a/apps/main.c
+++ b/apps/main.c
@@ -561,7 +561,7 @@ int main(void)
app_main();
while(1) {
-#if CONFIG_LED == LED_REAL
+#if defined(CONFIG_LED) && (CONFIG_LED == LED_REAL)
led(true); sleep(HZ/10);
led(false); sleep(HZ/10);
#endif
diff --git a/apps/recorder/icons.h b/apps/recorder/icons.h
index 668b5ca3ce..729e0328dc 100644
--- a/apps/recorder/icons.h
+++ b/apps/recorder/icons.h
@@ -173,7 +173,7 @@ extern void statusbar_icon_lock(void);
#ifdef CONFIG_RTC
extern void statusbar_time(int hour, int minute);
#endif
-#if CONFIG_LED == LED_VIRTUAL
+#if defined(CONFIG_LED) && (CONFIG_LED == LED_VIRTUAL)
extern void statusbar_led(void);
#endif
diff --git a/apps/recorder/recording.c b/apps/recorder/recording.c
index eb6f9b20ca..967df2826a 100644
--- a/apps/recorder/recording.c
+++ b/apps/recorder/recording.c
@@ -773,7 +773,7 @@ bool recording_screen(bool no_source)
FMRADIO_OFF : get_radio_status();
#endif
int talk_menu = global_settings.talk_menu;
-#if CONFIG_LED == LED_REAL
+#if defined(CONFIG_LED) && (CONFIG_LED == LED_REAL)
bool led_state = false;
int led_countdown = 2;
#endif
@@ -803,7 +803,7 @@ bool recording_screen(bool no_source)
in_screen = true;
cursor = 0;
-#if (CONFIG_LED == LED_REAL) && !defined(SIMULATOR)
+#if defined(CONFIG_LED) && (CONFIG_LED == LED_REAL) && !defined(SIMULATOR)
ata_set_led_enabled(false);
#endif
@@ -876,7 +876,7 @@ bool recording_screen(bool no_source)
{
audio_stat = audio_status();
-#if CONFIG_LED == LED_REAL
+#if defined(CONFIG_LED) && (CONFIG_LED == LED_REAL)
/*
* Flash the LED while waiting to record. Turn it on while
@@ -1188,7 +1188,7 @@ bool recording_screen(bool no_source)
const int prev_rec_source = global_settings.rec_source;
#endif
-#if CONFIG_LED == LED_REAL
+#if defined(CONFIG_LED) && (CONFIG_LED == LED_REAL)
/* led is restored at begin of loop / end of function */
led(false);
#endif
@@ -1251,7 +1251,7 @@ bool recording_screen(bool no_source)
case ACTION_REC_F2:
if(audio_stat != AUDIO_STATUS_RECORD)
{
-#if CONFIG_LED == LED_REAL
+#if defined(CONFIG_LED) && (CONFIG_LED == LED_REAL)
/* led is restored at begin of loop / end of function */
led(false);
#endif
@@ -1275,7 +1275,7 @@ bool recording_screen(bool no_source)
{
if(audio_stat != AUDIO_STATUS_RECORD)
{
-#if CONFIG_LED == LED_REAL
+#if defined(CONFIG_LED) && (CONFIG_LED == LED_REAL)
/* led is restored at begin of loop / end of function */
led(false);
#endif
@@ -1780,7 +1780,7 @@ bool recording_screen(bool no_source)
if (have_recorded)
reload_directory();
-#if (CONFIG_LED == LED_REAL) && !defined(SIMULATOR)
+#if defined(CONFIG_LED) && (CONFIG_LED == LED_REAL) && !defined(SIMULATOR)
ata_set_led_enabled(true);
#endif
return been_in_usb_mode;
diff --git a/apps/screen_access.c b/apps/screen_access.c
index e2714b2324..f2e38e95e1 100644
--- a/apps/screen_access.c
+++ b/apps/screen_access.c
@@ -111,7 +111,7 @@ void screen_init(struct screen * screen, enum screen_type screen_type)
case SCREEN_MAIN:
default:
screen->depth=LCD_DEPTH;
-#if CONFIG_LED == LED_VIRTUAL
+#if defined(CONFIG_LED) && (CONFIG_LED == LED_VIRTUAL)
screen->has_disk_led=false;
#elif defined(HAVE_REMOTE_LCD)
screen->has_disk_led=true;
diff --git a/apps/screen_access.h b/apps/screen_access.h
index 54f2d64fdb..befd7a6d3a 100644
--- a/apps/screen_access.h
+++ b/apps/screen_access.h
@@ -54,7 +54,7 @@ struct screen
int depth;
int char_width;
int char_height;
-#if (CONFIG_LED == LED_VIRTUAL) || defined(HAVE_REMOTE_LCD)
+#if (defined(CONFIG_LED) && (CONFIG_LED == LED_VIRTUAL)) || defined(HAVE_REMOTE_LCD)
bool has_disk_led;
#endif
#ifdef HAS_BUTTONBAR
diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c
index 91aae158c6..c3c2531a2e 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 CONFIG_LED == LED_REAL
+#if defined(CONFIG_LED) && (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 CONFIG_LED == LED_REAL
+#if defined(CONFIG_LED) && (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 CONFIG_LED == LED_REAL
+#if defined(CONFIG_LED) && (CONFIG_LED == LED_REAL)
void ata_set_led_enabled(bool enabled)
{
ata_led_enabled = enabled;
diff --git a/firmware/export/ata.h b/firmware/export/ata.h
index 915a71f536..697935cafc 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 CONFIG_LED == LED_REAL
+#if defined(CONFIG_LED) && (CONFIG_LED == LED_REAL)
extern void ata_set_led_enabled(bool enabled);
#endif
extern unsigned short* ata_get_identify(void);