diff options
author | Jonathan Gordon <rockbox@jdgordon.info> | 2007-02-18 05:07:19 +0000 |
---|---|---|
committer | Jonathan Gordon <rockbox@jdgordon.info> | 2007-02-18 05:07:19 +0000 |
commit | bd47d48c21ddcdd56b3654db78613d93739b8ce7 (patch) | |
tree | 78ddd13c384995b4220adc2c85eff233956420d2 | |
parent | ac61951452e001da48430d8487521ad32b7a123c (diff) | |
download | rockbox-bd47d48c21ddcdd56b3654db78613d93739b8ce7.tar.gz rockbox-bd47d48c21ddcdd56b3654db78613d93739b8ce7.zip |
Do the CONFIG_LED define
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12383 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/gui/gwps-common.c | 2 | ||||
-rw-r--r-- | apps/gui/statusbar.c | 8 | ||||
-rw-r--r-- | apps/gui/statusbar.h | 2 | ||||
-rw-r--r-- | apps/main.c | 4 | ||||
-rw-r--r-- | apps/recorder/icons.h | 2 | ||||
-rw-r--r-- | apps/recorder/recording.c | 14 | ||||
-rw-r--r-- | apps/screen_access.c | 2 | ||||
-rw-r--r-- | apps/screen_access.h | 2 | ||||
-rw-r--r-- | firmware/drivers/ata.c | 6 | ||||
-rw-r--r-- | firmware/drivers/led.c | 5 | ||||
-rw-r--r-- | firmware/export/ata.h | 2 | ||||
-rw-r--r-- | firmware/export/config.h | 4 | ||||
-rw-r--r-- | firmware/panic.c | 4 |
13 files changed, 30 insertions, 27 deletions
diff --git a/apps/gui/gwps-common.c b/apps/gui/gwps-common.c index 4404776c7f..d533e33f9c 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, | |||
845 | } | 845 | } |
846 | break; | 846 | break; |
847 | 847 | ||
848 | #if (defined(CONFIG_LED) && (CONFIG_LED == LED_VIRTUAL)) || defined(HAVE_REMOTE_LCD) | 848 | #if (CONFIG_LED == LED_VIRTUAL) || defined(HAVE_REMOTE_LCD) |
849 | case 'l': /* VIRTUAL_LED */ | 849 | case 'l': /* VIRTUAL_LED */ |
850 | { | 850 | { |
851 | switch(tag[1]) | 851 | switch(tag[1]) |
diff --git a/apps/gui/statusbar.c b/apps/gui/statusbar.c index 805b6a0ade..f1bd58d70f 100644 --- a/apps/gui/statusbar.c +++ b/apps/gui/statusbar.c | |||
@@ -116,7 +116,7 @@ | |||
116 | 7*ICONS_SPACING | 116 | 7*ICONS_SPACING |
117 | #define STATUSBAR_LOCKR_WIDTH 5 | 117 | #define STATUSBAR_LOCKR_WIDTH 5 |
118 | 118 | ||
119 | #if (defined(CONFIG_LED) && (CONFIG_LED == LED_VIRTUAL)) || defined(HAVE_REMOTE_LCD) | 119 | #if (CONFIG_LED == LED_VIRTUAL) || defined(HAVE_REMOTE_LCD) |
120 | #define STATUSBAR_DISK_WIDTH 12 | 120 | #define STATUSBAR_DISK_WIDTH 12 |
121 | #define STATUSBAR_DISK_X_POS(statusbar_width) statusbar_width - \ | 121 | #define STATUSBAR_DISK_X_POS(statusbar_width) statusbar_width - \ |
122 | STATUSBAR_DISK_WIDTH | 122 | STATUSBAR_DISK_WIDTH |
@@ -208,7 +208,7 @@ void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw) | |||
208 | bar->info.repeat = global_settings.repeat_mode; | 208 | bar->info.repeat = global_settings.repeat_mode; |
209 | bar->info.playmode = current_playmode(); | 209 | bar->info.playmode = current_playmode(); |
210 | 210 | ||
211 | #if (defined(CONFIG_LED) && (CONFIG_LED == LED_VIRTUAL)) || defined(HAVE_REMOTE_LCD) | 211 | #if (CONFIG_LED == LED_VIRTUAL) || defined(HAVE_REMOTE_LCD) |
212 | if(!display->has_disk_led) | 212 | if(!display->has_disk_led) |
213 | bar->info.led = led_read(HZ/2); /* delay should match polling interval */ | 213 | bar->info.led = led_read(HZ/2); /* delay should match polling interval */ |
214 | #endif | 214 | #endif |
@@ -300,7 +300,7 @@ void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw) | |||
300 | #ifdef CONFIG_RTC | 300 | #ifdef CONFIG_RTC |
301 | gui_statusbar_time(display, bar->info.hour, bar->info.minute); | 301 | gui_statusbar_time(display, bar->info.hour, bar->info.minute); |
302 | #endif /* CONFIG_RTC */ | 302 | #endif /* CONFIG_RTC */ |
303 | #if (defined(CONFIG_LED) && (CONFIG_LED == LED_VIRTUAL)) || defined(HAVE_REMOTE_LCD) | 303 | #if (CONFIG_LED == LED_VIRTUAL) || defined(HAVE_REMOTE_LCD) |
304 | if(!display->has_disk_led && bar->info.led) | 304 | if(!display->has_disk_led && bar->info.led) |
305 | gui_statusbar_led(display); | 305 | gui_statusbar_led(display); |
306 | #endif | 306 | #endif |
@@ -541,7 +541,7 @@ void gui_statusbar_icon_lock_remote(struct screen * display) | |||
541 | } | 541 | } |
542 | #endif | 542 | #endif |
543 | 543 | ||
544 | #if (defined(CONFIG_LED) && (CONFIG_LED == LED_VIRTUAL)) || defined(HAVE_REMOTE_LCD) | 544 | #if (CONFIG_LED == LED_VIRTUAL) || defined(HAVE_REMOTE_LCD) |
545 | /* | 545 | /* |
546 | * no real LED: disk activity in status bar | 546 | * no real LED: disk activity in status bar |
547 | */ | 547 | */ |
diff --git a/apps/gui/statusbar.h b/apps/gui/statusbar.h index 5190adc889..516598dd00 100644 --- a/apps/gui/statusbar.h +++ b/apps/gui/statusbar.h | |||
@@ -52,7 +52,7 @@ struct status_info { | |||
52 | #ifdef HAS_REMOTE_BUTTON_HOLD | 52 | #ifdef HAS_REMOTE_BUTTON_HOLD |
53 | bool keylockremote; | 53 | bool keylockremote; |
54 | #endif | 54 | #endif |
55 | #if (defined(CONFIG_LED) && (CONFIG_LED == LED_VIRTUAL)) || defined(HAVE_REMOTE_LCD) | 55 | #if (CONFIG_LED == LED_VIRTUAL) || defined(HAVE_REMOTE_LCD) |
56 | bool led; /* disk LED simulation in the status bar */ | 56 | bool led; /* disk LED simulation in the status bar */ |
57 | #endif | 57 | #endif |
58 | 58 | ||
diff --git a/apps/main.c b/apps/main.c index 9a55be8eda..22eda84f03 100644 --- a/apps/main.c +++ b/apps/main.c | |||
@@ -7,7 +7,7 @@ | |||
7 | * \/ \/ \/ \/ \/ | 7 | * \/ \/ \/ \/ \/ |
8 | * $Id$ | 8 | * $Id$ |
9 | * | 9 | * |
10 | * Copyright (C) 2002 by Björn Stenberg | 10 | * Copyright (C) 2002 by Bj�n Stenberg |
11 | * | 11 | * |
12 | * All files in this archive are subject to the GNU General Public License. | 12 | * All files in this archive are subject to the GNU General Public License. |
13 | * See the file COPYING in the source tree root for full license agreement. | 13 | * See the file COPYING in the source tree root for full license agreement. |
@@ -561,7 +561,7 @@ int main(void) | |||
561 | app_main(); | 561 | app_main(); |
562 | 562 | ||
563 | while(1) { | 563 | while(1) { |
564 | #if defined(CONFIG_LED) && (CONFIG_LED == LED_REAL) | 564 | #if (CONFIG_LED == LED_REAL) |
565 | led(true); sleep(HZ/10); | 565 | led(true); sleep(HZ/10); |
566 | led(false); sleep(HZ/10); | 566 | led(false); sleep(HZ/10); |
567 | #endif | 567 | #endif |
diff --git a/apps/recorder/icons.h b/apps/recorder/icons.h index 729e0328dc..bef1fa617b 100644 --- a/apps/recorder/icons.h +++ b/apps/recorder/icons.h | |||
@@ -173,7 +173,7 @@ extern void statusbar_icon_lock(void); | |||
173 | #ifdef CONFIG_RTC | 173 | #ifdef CONFIG_RTC |
174 | extern void statusbar_time(int hour, int minute); | 174 | extern void statusbar_time(int hour, int minute); |
175 | #endif | 175 | #endif |
176 | #if defined(CONFIG_LED) && (CONFIG_LED == LED_VIRTUAL) | 176 | #if (CONFIG_LED == LED_VIRTUAL) |
177 | extern void statusbar_led(void); | 177 | extern void statusbar_led(void); |
178 | #endif | 178 | #endif |
179 | 179 | ||
diff --git a/apps/recorder/recording.c b/apps/recorder/recording.c index d81b3690c8..8eea24d82d 100644 --- a/apps/recorder/recording.c +++ b/apps/recorder/recording.c | |||
@@ -773,7 +773,7 @@ bool recording_screen(bool no_source) | |||
773 | FMRADIO_OFF : get_radio_status(); | 773 | FMRADIO_OFF : get_radio_status(); |
774 | #endif | 774 | #endif |
775 | int talk_menu = global_settings.talk_menu; | 775 | int talk_menu = global_settings.talk_menu; |
776 | #if defined(CONFIG_LED) && (CONFIG_LED == LED_REAL) | 776 | #if (CONFIG_LED == LED_REAL) |
777 | bool led_state = false; | 777 | bool led_state = false; |
778 | int led_countdown = 2; | 778 | int led_countdown = 2; |
779 | #endif | 779 | #endif |
@@ -803,7 +803,7 @@ bool recording_screen(bool no_source) | |||
803 | 803 | ||
804 | in_screen = true; | 804 | in_screen = true; |
805 | cursor = 0; | 805 | cursor = 0; |
806 | #if defined(CONFIG_LED) && (CONFIG_LED == LED_REAL) && !defined(SIMULATOR) | 806 | #if (CONFIG_LED == LED_REAL) && !defined(SIMULATOR) |
807 | ata_set_led_enabled(false); | 807 | ata_set_led_enabled(false); |
808 | #endif | 808 | #endif |
809 | 809 | ||
@@ -876,7 +876,7 @@ bool recording_screen(bool no_source) | |||
876 | { | 876 | { |
877 | audio_stat = audio_status(); | 877 | audio_stat = audio_status(); |
878 | 878 | ||
879 | #if defined(CONFIG_LED) && (CONFIG_LED == LED_REAL) | 879 | #if (CONFIG_LED == LED_REAL) |
880 | 880 | ||
881 | /* | 881 | /* |
882 | * Flash the LED while waiting to record. Turn it on while | 882 | * Flash the LED while waiting to record. Turn it on while |
@@ -1188,7 +1188,7 @@ bool recording_screen(bool no_source) | |||
1188 | const int prev_rec_source = global_settings.rec_source; | 1188 | const int prev_rec_source = global_settings.rec_source; |
1189 | #endif | 1189 | #endif |
1190 | 1190 | ||
1191 | #if defined(CONFIG_LED) && (CONFIG_LED == LED_REAL) | 1191 | #if (CONFIG_LED == LED_REAL) |
1192 | /* led is restored at begin of loop / end of function */ | 1192 | /* led is restored at begin of loop / end of function */ |
1193 | led(false); | 1193 | led(false); |
1194 | #endif | 1194 | #endif |
@@ -1251,7 +1251,7 @@ bool recording_screen(bool no_source) | |||
1251 | case ACTION_REC_F2: | 1251 | case ACTION_REC_F2: |
1252 | if(audio_stat != AUDIO_STATUS_RECORD) | 1252 | if(audio_stat != AUDIO_STATUS_RECORD) |
1253 | { | 1253 | { |
1254 | #if defined(CONFIG_LED) && (CONFIG_LED == LED_REAL) | 1254 | #if (CONFIG_LED == LED_REAL) |
1255 | /* led is restored at begin of loop / end of function */ | 1255 | /* led is restored at begin of loop / end of function */ |
1256 | led(false); | 1256 | led(false); |
1257 | #endif | 1257 | #endif |
@@ -1275,7 +1275,7 @@ bool recording_screen(bool no_source) | |||
1275 | { | 1275 | { |
1276 | if(audio_stat != AUDIO_STATUS_RECORD) | 1276 | if(audio_stat != AUDIO_STATUS_RECORD) |
1277 | { | 1277 | { |
1278 | #if defined(CONFIG_LED) && (CONFIG_LED == LED_REAL) | 1278 | #if (CONFIG_LED == LED_REAL) |
1279 | /* led is restored at begin of loop / end of function */ | 1279 | /* led is restored at begin of loop / end of function */ |
1280 | led(false); | 1280 | led(false); |
1281 | #endif | 1281 | #endif |
@@ -1780,7 +1780,7 @@ bool recording_screen(bool no_source) | |||
1780 | if (have_recorded) | 1780 | if (have_recorded) |
1781 | reload_directory(); | 1781 | reload_directory(); |
1782 | 1782 | ||
1783 | #if defined(CONFIG_LED) && (CONFIG_LED == LED_REAL) && !defined(SIMULATOR) | 1783 | #if (CONFIG_LED == LED_REAL) && !defined(SIMULATOR) |
1784 | ata_set_led_enabled(true); | 1784 | ata_set_led_enabled(true); |
1785 | #endif | 1785 | #endif |
1786 | return been_in_usb_mode; | 1786 | return been_in_usb_mode; |
diff --git a/apps/screen_access.c b/apps/screen_access.c index f2e38e95e1..00db92769b 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) | |||
111 | case SCREEN_MAIN: | 111 | case SCREEN_MAIN: |
112 | default: | 112 | default: |
113 | screen->depth=LCD_DEPTH; | 113 | screen->depth=LCD_DEPTH; |
114 | #if defined(CONFIG_LED) && (CONFIG_LED == LED_VIRTUAL) | 114 | #if (CONFIG_LED == LED_VIRTUAL) |
115 | screen->has_disk_led=false; | 115 | screen->has_disk_led=false; |
116 | #elif defined(HAVE_REMOTE_LCD) | 116 | #elif defined(HAVE_REMOTE_LCD) |
117 | screen->has_disk_led=true; | 117 | screen->has_disk_led=true; |
diff --git a/apps/screen_access.h b/apps/screen_access.h index befd7a6d3a..54f2d64fdb 100644 --- a/apps/screen_access.h +++ b/apps/screen_access.h | |||
@@ -54,7 +54,7 @@ struct screen | |||
54 | int depth; | 54 | int depth; |
55 | int char_width; | 55 | int char_width; |
56 | int char_height; | 56 | int char_height; |
57 | #if (defined(CONFIG_LED) && (CONFIG_LED == LED_VIRTUAL)) || defined(HAVE_REMOTE_LCD) | 57 | #if (CONFIG_LED == LED_VIRTUAL) || defined(HAVE_REMOTE_LCD) |
58 | bool has_disk_led; | 58 | bool has_disk_led; |
59 | #endif | 59 | #endif |
60 | #ifdef HAS_BUTTONBAR | 60 | #ifdef HAS_BUTTONBAR |
diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c index c3c2531a2e..54a1b12143 100644 --- a/firmware/drivers/ata.c +++ b/firmware/drivers/ata.c | |||
@@ -71,7 +71,7 @@ static struct mutex ata_mtx; | |||
71 | int ata_device; /* device 0 (master) or 1 (slave) */ | 71 | int ata_device; /* device 0 (master) or 1 (slave) */ |
72 | 72 | ||
73 | int ata_spinup_time = 0; | 73 | int ata_spinup_time = 0; |
74 | #if defined(CONFIG_LED) && (CONFIG_LED == LED_REAL) | 74 | #if (CONFIG_LED == LED_REAL) |
75 | static bool ata_led_enabled = true; | 75 | static bool ata_led_enabled = true; |
76 | static bool ata_led_on = false; | 76 | static bool ata_led_on = false; |
77 | #endif | 77 | #endif |
@@ -152,7 +152,7 @@ STATICIRAM int wait_for_end_of_transfer(void) | |||
152 | return (ATA_ALT_STATUS & (STATUS_RDY|STATUS_DRQ)) == STATUS_RDY; | 152 | return (ATA_ALT_STATUS & (STATUS_RDY|STATUS_DRQ)) == STATUS_RDY; |
153 | } | 153 | } |
154 | 154 | ||
155 | #if defined(CONFIG_LED) && (CONFIG_LED == LED_REAL) | 155 | #if (CONFIG_LED == LED_REAL) |
156 | /* Conditionally block LED access for the ATA driver, so the LED can be | 156 | /* Conditionally block LED access for the ATA driver, so the LED can be |
157 | * (mis)used for other purposes */ | 157 | * (mis)used for other purposes */ |
158 | static void ata_led(bool on) | 158 | static void ata_led(bool on) |
@@ -1003,7 +1003,7 @@ int ata_init(void) | |||
1003 | return 0; | 1003 | return 0; |
1004 | } | 1004 | } |
1005 | 1005 | ||
1006 | #if defined(CONFIG_LED) && (CONFIG_LED == LED_REAL) | 1006 | #if (CONFIG_LED == LED_REAL) |
1007 | void ata_set_led_enabled(bool enabled) | 1007 | void ata_set_led_enabled(bool enabled) |
1008 | { | 1008 | { |
1009 | ata_led_enabled = enabled; | 1009 | ata_led_enabled = enabled; |
diff --git a/firmware/drivers/led.c b/firmware/drivers/led.c index 2799b7cd8c..36748a1b18 100644 --- a/firmware/drivers/led.c +++ b/firmware/drivers/led.c | |||
@@ -23,7 +23,7 @@ | |||
23 | #include "system.h" | 23 | #include "system.h" |
24 | #include "kernel.h" | 24 | #include "kernel.h" |
25 | 25 | ||
26 | #if (defined(CONFIG_LED) && (CONFIG_LED == LED_REAL)) | 26 | #if (CONFIG_LED == LED_REAL) |
27 | 27 | ||
28 | void led(bool on) | 28 | void led(bool on) |
29 | { | 29 | { |
@@ -37,8 +37,7 @@ void led(bool on) | |||
37 | } | 37 | } |
38 | } | 38 | } |
39 | 39 | ||
40 | #elif (defined(CONFIG_LED) && (CONFIG_LED == LED_VIRTUAL)) \ | 40 | #elif (CONFIG_LED == LED_VIRTUAL) || defined(HAVE_REMOTE_LCD) |
41 | || defined(HAVE_REMOTE_LCD) | ||
42 | 41 | ||
43 | static bool current; | 42 | static bool current; |
44 | static long last_on; /* timestamp of switching off */ | 43 | static long last_on; /* timestamp of switching off */ |
diff --git a/firmware/export/ata.h b/firmware/export/ata.h index 697935cafc..d3323308e8 100644 --- a/firmware/export/ata.h +++ b/firmware/export/ata.h | |||
@@ -47,7 +47,7 @@ extern int ata_init(void); | |||
47 | extern int ata_read_sectors(IF_MV2(int drive,) unsigned long start, int count, void* buf); | 47 | extern int ata_read_sectors(IF_MV2(int drive,) unsigned long start, int count, void* buf); |
48 | extern int ata_write_sectors(IF_MV2(int drive,) unsigned long start, int count, const void* buf); | 48 | extern int ata_write_sectors(IF_MV2(int drive,) unsigned long start, int count, const void* buf); |
49 | extern void ata_spin(void); | 49 | extern void ata_spin(void); |
50 | #if defined(CONFIG_LED) && (CONFIG_LED == LED_REAL) | 50 | #if (CONFIG_LED == LED_REAL) |
51 | extern void ata_set_led_enabled(bool enabled); | 51 | extern void ata_set_led_enabled(bool enabled); |
52 | #endif | 52 | #endif |
53 | extern unsigned short* ata_get_identify(void); | 53 | extern unsigned short* ata_get_identify(void); |
diff --git a/firmware/export/config.h b/firmware/export/config.h index aaaac686b1..0a59c0bf89 100644 --- a/firmware/export/config.h +++ b/firmware/export/config.h | |||
@@ -226,6 +226,10 @@ | |||
226 | #define CONFIG_USBOTG 0 | 226 | #define CONFIG_USBOTG 0 |
227 | #endif | 227 | #endif |
228 | 228 | ||
229 | #ifndef CONFIG_LED | ||
230 | #define CONFIG_LED 0 | ||
231 | #endif | ||
232 | |||
229 | /* Enable the directory cache and tagcache in RAM if we have | 233 | /* Enable the directory cache and tagcache in RAM if we have |
230 | * plenty of RAM. Both features can be enabled independently. */ | 234 | * plenty of RAM. Both features can be enabled independently. */ |
231 | #if ((defined(MEMORYSIZE) && (MEMORYSIZE > 8)) || MEM > 8) && \ | 235 | #if ((defined(MEMORYSIZE) && (MEMORYSIZE > 8)) || MEM > 8) && \ |
diff --git a/firmware/panic.c b/firmware/panic.c index 8d6b0e5bb5..c50bd54457 100644 --- a/firmware/panic.c +++ b/firmware/panic.c | |||
@@ -39,7 +39,7 @@ void panicf( const char *fmt, ...) | |||
39 | va_list ap; | 39 | va_list ap; |
40 | 40 | ||
41 | #ifndef SIMULATOR | 41 | #ifndef SIMULATOR |
42 | #if (defined(CONFIG_LED) && (CONFIG_LED == LED_REAL)) | 42 | #if (CONFIG_LED == LED_REAL) |
43 | bool state = false; | 43 | bool state = false; |
44 | int i = 0; | 44 | int i = 0; |
45 | #endif | 45 | #endif |
@@ -90,7 +90,7 @@ void panicf( const char *fmt, ...) | |||
90 | while (1) | 90 | while (1) |
91 | { | 91 | { |
92 | #ifndef SIMULATOR | 92 | #ifndef SIMULATOR |
93 | #if (defined(CONFIG_LED) && (CONFIG_LED == LED_REAL)) | 93 | #if (CONFIG_LED == LED_REAL) |
94 | if (--i <= 0) | 94 | if (--i <= 0) |
95 | { | 95 | { |
96 | state = !state; | 96 | state = !state; |