Do the CONFIG_LED define

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12383 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jonathan Gordon 2007-02-18 05:07:19 +00:00
parent ac61951452
commit bd47d48c21
13 changed files with 30 additions and 27 deletions

View file

@ -845,7 +845,7 @@ static char* get_tag(struct wps_data* wps_data,
} }
break; break;
#if (defined(CONFIG_LED) && (CONFIG_LED == LED_VIRTUAL)) || defined(HAVE_REMOTE_LCD) #if (CONFIG_LED == LED_VIRTUAL) || defined(HAVE_REMOTE_LCD)
case 'l': /* VIRTUAL_LED */ case 'l': /* VIRTUAL_LED */
{ {
switch(tag[1]) switch(tag[1])

View file

@ -116,7 +116,7 @@
7*ICONS_SPACING 7*ICONS_SPACING
#define STATUSBAR_LOCKR_WIDTH 5 #define STATUSBAR_LOCKR_WIDTH 5
#if (defined(CONFIG_LED) && (CONFIG_LED == LED_VIRTUAL)) || defined(HAVE_REMOTE_LCD) #if (CONFIG_LED == LED_VIRTUAL) || defined(HAVE_REMOTE_LCD)
#define STATUSBAR_DISK_WIDTH 12 #define STATUSBAR_DISK_WIDTH 12
#define STATUSBAR_DISK_X_POS(statusbar_width) statusbar_width - \ #define STATUSBAR_DISK_X_POS(statusbar_width) statusbar_width - \
STATUSBAR_DISK_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.repeat = global_settings.repeat_mode;
bar->info.playmode = current_playmode(); bar->info.playmode = current_playmode();
#if (defined(CONFIG_LED) && (CONFIG_LED == LED_VIRTUAL)) || defined(HAVE_REMOTE_LCD) #if (CONFIG_LED == LED_VIRTUAL) || defined(HAVE_REMOTE_LCD)
if(!display->has_disk_led) if(!display->has_disk_led)
bar->info.led = led_read(HZ/2); /* delay should match polling interval */ bar->info.led = led_read(HZ/2); /* delay should match polling interval */
#endif #endif
@ -300,7 +300,7 @@ void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw)
#ifdef CONFIG_RTC #ifdef CONFIG_RTC
gui_statusbar_time(display, bar->info.hour, bar->info.minute); gui_statusbar_time(display, bar->info.hour, bar->info.minute);
#endif /* CONFIG_RTC */ #endif /* CONFIG_RTC */
#if (defined(CONFIG_LED) && (CONFIG_LED == LED_VIRTUAL)) || defined(HAVE_REMOTE_LCD) #if (CONFIG_LED == LED_VIRTUAL) || defined(HAVE_REMOTE_LCD)
if(!display->has_disk_led && bar->info.led) if(!display->has_disk_led && bar->info.led)
gui_statusbar_led(display); gui_statusbar_led(display);
#endif #endif
@ -541,7 +541,7 @@ void gui_statusbar_icon_lock_remote(struct screen * display)
} }
#endif #endif
#if (defined(CONFIG_LED) && (CONFIG_LED == LED_VIRTUAL)) || defined(HAVE_REMOTE_LCD) #if (CONFIG_LED == LED_VIRTUAL) || defined(HAVE_REMOTE_LCD)
/* /*
* no real LED: disk activity in status bar * no real LED: disk activity in status bar
*/ */

View file

@ -52,7 +52,7 @@ struct status_info {
#ifdef HAS_REMOTE_BUTTON_HOLD #ifdef HAS_REMOTE_BUTTON_HOLD
bool keylockremote; bool keylockremote;
#endif #endif
#if (defined(CONFIG_LED) && (CONFIG_LED == LED_VIRTUAL)) || defined(HAVE_REMOTE_LCD) #if (CONFIG_LED == LED_VIRTUAL) || defined(HAVE_REMOTE_LCD)
bool led; /* disk LED simulation in the status bar */ bool led; /* disk LED simulation in the status bar */
#endif #endif

View file

@ -7,7 +7,7 @@
* \/ \/ \/ \/ \/ * \/ \/ \/ \/ \/
* $Id$ * $Id$
* *
* Copyright (C) 2002 by Björn Stenberg * Copyright (C) 2002 by Bj<EFBFBD>n Stenberg
* *
* All files in this archive are subject to the GNU General Public License. * All files in this archive are subject to the GNU General Public License.
* See the file COPYING in the source tree root for full license agreement. * See the file COPYING in the source tree root for full license agreement.
@ -561,7 +561,7 @@ int main(void)
app_main(); app_main();
while(1) { while(1) {
#if defined(CONFIG_LED) && (CONFIG_LED == LED_REAL) #if (CONFIG_LED == LED_REAL)
led(true); sleep(HZ/10); led(true); sleep(HZ/10);
led(false); sleep(HZ/10); led(false); sleep(HZ/10);
#endif #endif

View file

@ -173,7 +173,7 @@ extern void statusbar_icon_lock(void);
#ifdef CONFIG_RTC #ifdef CONFIG_RTC
extern void statusbar_time(int hour, int minute); extern void statusbar_time(int hour, int minute);
#endif #endif
#if defined(CONFIG_LED) && (CONFIG_LED == LED_VIRTUAL) #if (CONFIG_LED == LED_VIRTUAL)
extern void statusbar_led(void); extern void statusbar_led(void);
#endif #endif

View file

@ -773,7 +773,7 @@ bool recording_screen(bool no_source)
FMRADIO_OFF : get_radio_status(); FMRADIO_OFF : get_radio_status();
#endif #endif
int talk_menu = global_settings.talk_menu; int talk_menu = global_settings.talk_menu;
#if defined(CONFIG_LED) && (CONFIG_LED == LED_REAL) #if (CONFIG_LED == LED_REAL)
bool led_state = false; bool led_state = false;
int led_countdown = 2; int led_countdown = 2;
#endif #endif
@ -803,7 +803,7 @@ bool recording_screen(bool no_source)
in_screen = true; in_screen = true;
cursor = 0; cursor = 0;
#if defined(CONFIG_LED) && (CONFIG_LED == LED_REAL) && !defined(SIMULATOR) #if (CONFIG_LED == LED_REAL) && !defined(SIMULATOR)
ata_set_led_enabled(false); ata_set_led_enabled(false);
#endif #endif
@ -876,7 +876,7 @@ bool recording_screen(bool no_source)
{ {
audio_stat = audio_status(); audio_stat = audio_status();
#if defined(CONFIG_LED) && (CONFIG_LED == LED_REAL) #if (CONFIG_LED == LED_REAL)
/* /*
* Flash the LED while waiting to record. Turn it on while * 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; const int prev_rec_source = global_settings.rec_source;
#endif #endif
#if defined(CONFIG_LED) && (CONFIG_LED == LED_REAL) #if (CONFIG_LED == LED_REAL)
/* led is restored at begin of loop / end of function */ /* led is restored at begin of loop / end of function */
led(false); led(false);
#endif #endif
@ -1251,7 +1251,7 @@ bool recording_screen(bool no_source)
case ACTION_REC_F2: case ACTION_REC_F2:
if(audio_stat != AUDIO_STATUS_RECORD) if(audio_stat != AUDIO_STATUS_RECORD)
{ {
#if defined(CONFIG_LED) && (CONFIG_LED == LED_REAL) #if (CONFIG_LED == LED_REAL)
/* led is restored at begin of loop / end of function */ /* led is restored at begin of loop / end of function */
led(false); led(false);
#endif #endif
@ -1275,7 +1275,7 @@ bool recording_screen(bool no_source)
{ {
if(audio_stat != AUDIO_STATUS_RECORD) if(audio_stat != AUDIO_STATUS_RECORD)
{ {
#if defined(CONFIG_LED) && (CONFIG_LED == LED_REAL) #if (CONFIG_LED == LED_REAL)
/* led is restored at begin of loop / end of function */ /* led is restored at begin of loop / end of function */
led(false); led(false);
#endif #endif
@ -1780,7 +1780,7 @@ bool recording_screen(bool no_source)
if (have_recorded) if (have_recorded)
reload_directory(); reload_directory();
#if defined(CONFIG_LED) && (CONFIG_LED == LED_REAL) && !defined(SIMULATOR) #if (CONFIG_LED == LED_REAL) && !defined(SIMULATOR)
ata_set_led_enabled(true); ata_set_led_enabled(true);
#endif #endif
return been_in_usb_mode; return been_in_usb_mode;

View file

@ -111,7 +111,7 @@ void screen_init(struct screen * screen, enum screen_type screen_type)
case SCREEN_MAIN: case SCREEN_MAIN:
default: default:
screen->depth=LCD_DEPTH; screen->depth=LCD_DEPTH;
#if defined(CONFIG_LED) && (CONFIG_LED == LED_VIRTUAL) #if (CONFIG_LED == LED_VIRTUAL)
screen->has_disk_led=false; screen->has_disk_led=false;
#elif defined(HAVE_REMOTE_LCD) #elif defined(HAVE_REMOTE_LCD)
screen->has_disk_led=true; screen->has_disk_led=true;

View file

@ -54,7 +54,7 @@ struct screen
int depth; int depth;
int char_width; int char_width;
int char_height; int char_height;
#if (defined(CONFIG_LED) && (CONFIG_LED == LED_VIRTUAL)) || defined(HAVE_REMOTE_LCD) #if (CONFIG_LED == LED_VIRTUAL) || defined(HAVE_REMOTE_LCD)
bool has_disk_led; bool has_disk_led;
#endif #endif
#ifdef HAS_BUTTONBAR #ifdef HAS_BUTTONBAR

View file

@ -71,7 +71,7 @@ static struct mutex ata_mtx;
int ata_device; /* device 0 (master) or 1 (slave) */ int ata_device; /* device 0 (master) or 1 (slave) */
int ata_spinup_time = 0; 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_enabled = true;
static bool ata_led_on = false; static bool ata_led_on = false;
#endif #endif
@ -152,7 +152,7 @@ STATICIRAM int wait_for_end_of_transfer(void)
return (ATA_ALT_STATUS & (STATUS_RDY|STATUS_DRQ)) == STATUS_RDY; 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 /* Conditionally block LED access for the ATA driver, so the LED can be
* (mis)used for other purposes */ * (mis)used for other purposes */
static void ata_led(bool on) static void ata_led(bool on)
@ -1003,7 +1003,7 @@ int ata_init(void)
return 0; return 0;
} }
#if defined(CONFIG_LED) && (CONFIG_LED == LED_REAL) #if (CONFIG_LED == LED_REAL)
void ata_set_led_enabled(bool enabled) void ata_set_led_enabled(bool enabled)
{ {
ata_led_enabled = enabled; ata_led_enabled = enabled;

View file

@ -23,7 +23,7 @@
#include "system.h" #include "system.h"
#include "kernel.h" #include "kernel.h"
#if (defined(CONFIG_LED) && (CONFIG_LED == LED_REAL)) #if (CONFIG_LED == LED_REAL)
void led(bool on) void led(bool on)
{ {
@ -37,8 +37,7 @@ void led(bool on)
} }
} }
#elif (defined(CONFIG_LED) && (CONFIG_LED == LED_VIRTUAL)) \ #elif (CONFIG_LED == LED_VIRTUAL) || defined(HAVE_REMOTE_LCD)
|| defined(HAVE_REMOTE_LCD)
static bool current; static bool current;
static long last_on; /* timestamp of switching off */ static long last_on; /* timestamp of switching off */

View file

@ -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_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 int ata_write_sectors(IF_MV2(int drive,) unsigned long start, int count, const void* buf);
extern void ata_spin(void); 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); extern void ata_set_led_enabled(bool enabled);
#endif #endif
extern unsigned short* ata_get_identify(void); extern unsigned short* ata_get_identify(void);

View file

@ -226,6 +226,10 @@
#define CONFIG_USBOTG 0 #define CONFIG_USBOTG 0
#endif #endif
#ifndef CONFIG_LED
#define CONFIG_LED 0
#endif
/* Enable the directory cache and tagcache in RAM if we have /* Enable the directory cache and tagcache in RAM if we have
* plenty of RAM. Both features can be enabled independently. */ * plenty of RAM. Both features can be enabled independently. */
#if ((defined(MEMORYSIZE) && (MEMORYSIZE > 8)) || MEM > 8) && \ #if ((defined(MEMORYSIZE) && (MEMORYSIZE > 8)) || MEM > 8) && \

View file

@ -39,7 +39,7 @@ void panicf( const char *fmt, ...)
va_list ap; va_list ap;
#ifndef SIMULATOR #ifndef SIMULATOR
#if (defined(CONFIG_LED) && (CONFIG_LED == LED_REAL)) #if (CONFIG_LED == LED_REAL)
bool state = false; bool state = false;
int i = 0; int i = 0;
#endif #endif
@ -90,7 +90,7 @@ void panicf( const char *fmt, ...)
while (1) while (1)
{ {
#ifndef SIMULATOR #ifndef SIMULATOR
#if (defined(CONFIG_LED) && (CONFIG_LED == LED_REAL)) #if (CONFIG_LED == LED_REAL)
if (--i <= 0) if (--i <= 0)
{ {
state = !state; state = !state;