Moved archos backlight code to target tree. Changed old mutlivalue CONFIG_BACKLIGHT to a simple HAVE_BACKLIGHT.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13136 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jens Arnold 2007-04-12 22:12:13 +00:00
parent 734278b7d1
commit 47bf6c5a5a
53 changed files with 256 additions and 152 deletions

View file

@ -1901,7 +1901,7 @@ bool gui_wps_refresh(struct gui_wps *gwps,
display->update();
#if CONFIG_BACKLIGHT
#ifdef HAVE_BACKLIGHT
if (global_settings.caption_backlight && state->id3)
{
/* turn on backlight n seconds before track ends, and turn it off n

View file

@ -38,7 +38,7 @@
#include "lcd-remote.h"
#if CONFIG_BACKLIGHT
#ifdef HAVE_BACKLIGHT
int filterfirstkeypress_callback(int action,const struct menu_item_ex *this_item)
{
(void)this_item;
@ -77,7 +77,7 @@ int flipdisplay_callback(int action,const struct menu_item_ex *this_item)
/***********************************/
/* LCD MENU */
#if CONFIG_BACKLIGHT
#ifdef HAVE_BACKLIGHT
MENUITEM_SETTING(backlight_timeout, &global_settings.backlight_timeout, NULL);
#if CONFIG_CHARGING
MENUITEM_SETTING(backlight_timeout_plugged,
@ -102,7 +102,7 @@ MENUITEM_SETTING(lcd_sleep_after_backlight_off,
#ifdef HAVE_BACKLIGHT_BRIGHTNESS
MENUITEM_SETTING(brightness_item, &global_settings.brightness, NULL);
#endif
#endif /* CONFIG_BACKLIGHT */
#endif /* HAVE_BACKLIGHT */
#ifdef HAVE_LCD_CONTRAST
MENUITEM_SETTING(contrast, &global_settings.contrast, NULL);
#endif
@ -173,7 +173,7 @@ MENUITEM_FUNCTION(reset_colors, 0, ID2P(LANG_RESET_COLORS),
/* now the actual menu */
MAKE_MENU(lcd_settings,ID2P(LANG_LCD_MENU),
NULL, Icon_Display_menu
#if CONFIG_BACKLIGHT
#ifdef HAVE_BACKLIGHT
,&backlight_timeout
# if CONFIG_CHARGING
,&backlight_timeout_plugged
@ -192,7 +192,7 @@ MAKE_MENU(lcd_settings,ID2P(LANG_LCD_MENU),
# ifdef HAVE_BACKLIGHT_BRIGHTNESS
,&brightness_item
# endif
#endif /* CONFIG_BACKLIGHT */
#endif /* HAVE_BACKLIGHT */
#ifdef HAVE_LCD_CONTRAST
,&contrast
#endif

View file

@ -822,7 +822,7 @@ MAKE_MENU(recording_setting_menu, ID2P(LANG_RECORDING_SETTINGS), NULL, Icon_Reco
&filesplitoptionsmenu,
&rec_prerecord_time,
&recdirectory,
#if CONFIG_BACKLIGHT
#ifdef HAVE_BACKLIGHT
&cliplight,
#endif
&rectrigger_item,

View file

@ -3294,7 +3294,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
(actually it should also set the timeout when plugged in,
but the function backlight_set_timeout_plugged is not
available in plugins) */
#if CONFIG_BACKLIGHT
#ifdef HAVE_BACKLIGHT
if (rb->global_settings->backlight_timeout > 0)
rb->backlight_set_timeout(1);
#endif
@ -3320,7 +3320,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
rb->ata_spindown(rb->global_settings->disk_spindown);
#endif
#if CONFIG_BACKLIGHT
#ifdef HAVE_BACKLIGHT
/* reset backlight settings */
rb->backlight_set_timeout(rb->global_settings->backlight_timeout);
#endif

View file

@ -1645,7 +1645,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
(actually it should also set the timeout when plugged in,
but the function backlight_set_timeout_plugged is not
available in plugins) */
#if CONFIG_BACKLIGHT
#ifdef HAVE_BACKLIGHT
if (rb->global_settings->backlight_timeout > 0)
rb->backlight_set_timeout(1);
#endif
@ -1778,7 +1778,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
save_settings(); /* Save settings (if they have changed) */
#if CONFIG_BACKLIGHT
#ifdef HAVE_BACKLIGHT
/* reset backlight settings */
rb->backlight_set_timeout(rb->global_settings->backlight_timeout);
#endif

View file

@ -34,7 +34,7 @@
#include "peakmeter.h"
#include "audio.h"
#include "screen_access.h"
#if CONFIG_BACKLIGHT
#ifdef HAVE_BACKLIGHT
#include "backlight.h"
#endif
#include "action.h"
@ -1008,7 +1008,7 @@ void peak_meter_draw(struct screen *display, struct meter_scales *scales,
#ifdef HAVE_RECORDING
#if CONFIG_BACKLIGHT
#ifdef HAVE_BACKLIGHT
/* cliplight */
if ((pm_clip_left || pm_clip_right) &&
global_settings.cliplight &&
@ -1032,7 +1032,7 @@ void peak_meter_draw(struct screen *display, struct meter_scales *scales,
}
#endif /* HAVE_REMOTE_LCD */
}
#endif /* CONFIG_BACKLIGHT */
#endif /* HAVE_BACKLIGHT */
if (trig_status != TRIG_OFF) {
int start_trigx, stop_trigx, ycenter;

View file

@ -699,7 +699,7 @@ void settings_apply(void)
remote_backlight_set_on_button_hold(global_settings.remote_backlight_on_button_hold);
#endif
#endif /* HAVE_REMOTE_LCD */
#if CONFIG_BACKLIGHT
#ifdef HAVE_BACKLIGHT
backlight_set_timeout(global_settings.backlight_timeout);
#if CONFIG_CHARGING
backlight_set_timeout_plugged(global_settings.backlight_timeout_plugged);
@ -836,7 +836,7 @@ void settings_apply(void)
spdif_power_enable(global_settings.spdif_enable);
#endif
#if CONFIG_BACKLIGHT
#ifdef HAVE_BACKLIGHT
set_backlight_filter_keypress(global_settings.bl_filter_first_keypress);
#ifdef HAVE_REMOTE_LCD
set_remote_backlight_filter_keypress(global_settings.remote_bl_filter_first_keypress);
@ -847,7 +847,7 @@ void settings_apply(void)
#ifdef HAVE_LCD_SLEEP
lcd_set_sleep_after_backlight_off(global_settings.lcd_sleep_after_backlight_off);
#endif
#endif /* CONFIG_BACKLIGHT */
#endif /* HAVE_BACKLIGHT */
/* This should stay last */
#if defined(HAVE_RECORDING) && CONFIG_CODEC == SWCODEC

View file

@ -626,7 +626,7 @@ struct user_settings
#endif
bool party_mode; /* party mode - unstoppable music */
#if CONFIG_BACKLIGHT
#ifdef HAVE_BACKLIGHT
bool bl_filter_first_keypress; /* filter first keypress when dark? */
#ifdef HAVE_REMOTE_LCD
bool remote_bl_filter_first_keypress; /* filter first remote keypress when remote dark? */
@ -639,7 +639,7 @@ struct user_settings
int lcd_sleep_after_backlight_off; /* when to put lcd to sleep after backlight
has turned off */
#endif
#endif /* CONFIG_BACKLIGHT */
#endif /* HAVE_BACKLIGHT */
#ifdef HAVE_LCD_BITMAP
unsigned char kbd_file[MAX_FILENAME+1]; /* last keyboard */

View file

@ -107,7 +107,7 @@ static void rectime_formatter(char *buffer, int buffer_size,
#endif /* HAVE_RECORDING */
#if CONFIG_BACKLIGHT
#ifdef HAVE_BACKLIGHT
static const char backlight_times_conf [] =
"off,on,1,2,3,4,5,6,7,8,9,10,15,20,25,30,45,60,90";
static const int backlight_times[] =
@ -405,7 +405,7 @@ const struct settings_list settings[] = {
{ lcd_set_contrast, UNIT_INT, MIN_CONTRAST_SETTING,
MAX_CONTRAST_SETTING, 1, NULL, NULL}}}},
#endif
#if CONFIG_BACKLIGHT
#ifdef HAVE_BACKLIGHT
INT_SETTING_W_CFGVALS(F_FLIPLIST, backlight_timeout, LANG_BACKLIGHT, 6,
"backlight timeout", backlight_times_conf, UNIT_SEC,
0, 18, 1, backlight_formatter, backlight_getlang,
@ -417,7 +417,7 @@ const struct settings_list settings[] = {
0, 18, 1, backlight_formatter, backlight_getlang,
backlight_set_timeout_plugged),
#endif
#endif /* CONFIG_BACKLIGHT */
#endif /* HAVE_BACKLIGHT */
#ifdef HAVE_LCD_BITMAP
BOOL_SETTING(0, invert, LANG_INVERT, false ,"invert", off_on,
LANG_INVERT_LCD_INVERSE, LANG_INVERT_LCD_NORMAL, lcd_set_invert_display),
@ -512,7 +512,7 @@ const struct settings_list settings[] = {
#endif
#endif
#if CONFIG_BACKLIGHT
#ifdef HAVE_BACKLIGHT
OFFON_SETTING(0,bl_filter_first_keypress,
LANG_BACKLIGHT_FILTER_FIRST_KEYPRESS, false,
"backlight filters first keypress", NULL),
@ -521,18 +521,18 @@ const struct settings_list settings[] = {
LANG_BACKLIGHT_FILTER_FIRST_KEYPRESS, false,
"backlight filters first remote keypress", NULL),
#endif
#endif /* CONFIG_BACKLIGHT */
#endif /* HAVE_BACKLIGHT */
/** End of old RTC config block **/
#if CONFIG_BACKLIGHT
#ifdef HAVE_BACKLIGHT
OFFON_SETTING(0,caption_backlight, LANG_CAPTION_BACKLIGHT,
false,"caption backlight",NULL),
#ifdef HAVE_REMOTE_LCD
OFFON_SETTING(0,remote_caption_backlight, LANG_CAPTION_BACKLIGHT,
false,"remote caption backlight",NULL),
#endif
#endif /* CONFIG_BACKLIGHT */
#endif /* HAVE_BACKLIGHT */
#ifdef HAVE_BACKLIGHT_BRIGHTNESS
INT_SETTING(0, brightness, LANG_BRIGHTNESS, DEFAULT_BRIGHTNESS_SETTING,
"brightness",UNIT_INT, MIN_BRIGHTNESS_SETTING, MAX_BRIGHTNESS_SETTING, 1,
@ -759,7 +759,7 @@ const struct settings_list settings[] = {
UNIT_SEC, 0, 30, 1, rectime_formatter, rectime_getlang, NULL),
{F_T_INT,&global_settings.rec_directory,LANG_RECORD_DIRECTORY,
INT(0),"rec directory",REC_BASE_DIR ",current",UNUSED},
#if CONFIG_BACKLIGHT
#ifdef HAVE_BACKLIGHT
CHOICE_SETTING(0, cliplight, LANG_CLIP_LIGHT, 0 ,
"cliplight", "off,main,both,remote", NULL,
#ifdef HAVE_REMOTE_LCD
@ -974,7 +974,7 @@ const struct settings_list settings[] = {
LANG_WARN_ERASEDYNPLAYLIST_MENU,false,
"warn when erasing dynamic playlist",NULL),
#if CONFIG_BACKLIGHT
#ifdef HAVE_BACKLIGHT
#ifdef HAS_BUTTON_HOLD
CHOICE_SETTING(0, backlight_on_button_hold,
LANG_BACKLIGHT_ON_BUTTON_HOLD, 0, "backlight on button hold",
@ -991,7 +991,7 @@ const struct settings_list settings[] = {
TALK_ID(15, UNIT_SEC), TALK_ID(20, UNIT_SEC), TALK_ID(30, UNIT_SEC),
TALK_ID(45, UNIT_SEC),TALK_ID(60, UNIT_SEC), TALK_ID(90, UNIT_SEC)),
#endif
#endif /* CONFIG_BACKLIGHT */
#endif /* HAVE_BACKLIGHT */
#ifdef HAVE_WM8758
OFFON_SETTING(0,eq_hw_enabled,LANG_EQUALIZER_HARDWARE_ENABLED,false,

View file

@ -37,7 +37,7 @@
#ifdef HAVE_REMOTE_LCD
#include "lcd-remote.h"
#endif
#if defined(TARGET_TREE) && !defined(SIMULATOR)
#ifndef SIMULATOR
#include "backlight-target.h"
#endif
@ -58,39 +58,9 @@ static inline void __backlight_set_brightness(int val)
(void)val;
}
#endif
#else
/* Basic low-level code that simply switches backlight on or off. Probably
* a nice candidate for inclusion in the target/ dir. */
#ifndef TARGET_TREE
static inline void __backlight_on(void)
{
#if CONFIG_BACKLIGHT == BL_RTC
/* Enable square wave */
rtc_write(0x0a, rtc_read(0x0a) | 0x40);
#elif CONFIG_BACKLIGHT == BL_PA14_LO /* Player */
and_b(~0x40, &PADRH); /* drive and set low */
or_b(0x40, &PAIORH);
#elif CONFIG_BACKLIGHT == BL_PA14_HI /* Ondio */
or_b(0x40, &PADRH); /* drive it high */
#endif
}
static inline void __backlight_off(void)
{
#if CONFIG_BACKLIGHT == BL_RTC
/* Disable square wave */
rtc_write(0x0a, rtc_read(0x0a) & ~0x40);
#elif CONFIG_BACKLIGHT == BL_PA14_LO /* Player */
and_b(~0x40, &PAIORH); /* let it float (up) */
#elif CONFIG_BACKLIGHT == BL_PA14_HI /* Ondio */
and_b(~0x40, &PADRH); /* drive it low */
#endif
}
#endif
#endif /* SIMULATOR */
#if CONFIG_BACKLIGHT && !defined(BOOTLOADER)
#if defined(HAVE_BACKLIGHT) && !defined(BOOTLOADER)
const signed char backlight_timeout_value[19] =
{
@ -558,23 +528,15 @@ void backlight_init(void)
queue_init(&backlight_queue, true);
queue_set_irq_safe(&backlight_queue, true);
#ifdef SIMULATOR
/* do nothing */
#elif defined(__BACKLIGHT_INIT)
/* Remove the __BACKLIGHT_INIT references when __backlight_init is
available on all backlighted targets. Take them out of the
backlight-target.h files as well */
#ifndef SIMULATOR
if (__backlight_init())
{
# if defined(HAVE_BACKLIGHT_PWM_FADING) && !defined(SIMULATOR)
# ifdef HAVE_BACKLIGHT_PWM_FADING
/* If backlight is already on, don't fade in. */
bl_dim_current = BL_PWM_COUNT;
bl_dim_target = BL_PWM_COUNT;
# endif
}
#elif CONFIG_BACKLIGHT == BL_PA14_LO || CONFIG_BACKLIGHT == BL_PA14_HI
PACR1 &= ~0x3000; /* Set PA14 (backlight control) to GPIO */
or_b(0x40, &PAIORH); /* ..and output */
#endif
backlight_on();
#ifdef HAVE_REMOTE_LCD
@ -806,16 +768,14 @@ void backlight_set_brightness(int val)
}
#endif /* HAVE_BACKLIGHT_BRIGHTNESS */
#else /* (CONFIG_BACKLIGHT == 0) || defined(BOOTLOADER)
#else /* !defined(HAVE_BACKLIGHT) || defined(BOOTLOADER)
-- no backlight, empty dummy functions */
#if defined(BOOTLOADER) && CONFIG_BACKLIGHT
#if defined(BOOTLOADER) && defined(HAVE_BACKLIGHT)
void backlight_init(void)
{
#ifdef __BACKLIGHT_INIT
__backlight_init();
__backlight_on();
#endif
}
#endif
@ -832,4 +792,4 @@ bool is_remote_backlight_on(void) {return true;}
#ifdef HAVE_BACKLIGHT_BRIGHTNESS
void backlight_set_brightness(int val) { (void)val; }
#endif
#endif /* CONFIG_BACKLIGHT && !defined(BOOTLOADER) */
#endif /* defined(HAVE_BACKLIGHT) && !defined(BOOTLOADER) */

View file

@ -52,12 +52,12 @@ static long last_read; /* Last button status, for debouncing/filtering */
#ifdef HAVE_LCD_BITMAP
static bool flipped; /* buttons can be flipped to match the LCD flip */
#endif
#if CONFIG_BACKLIGHT
#ifdef HAVE_BACKLIGHT
static bool filter_first_keypress;
#ifdef HAVE_REMOTE_LCD
static bool remote_filter_first_keypress;
#endif
#endif /* CONFIG_BACKLIGHT */
#endif /* HAVE_BACKLIGHT */
#ifdef HAVE_HEADPHONE_DETECTION
bool phones_present = false;
#endif
@ -80,7 +80,7 @@ static void button_tick(void)
static int repeat_count = 0;
static bool repeat = false;
static bool post = false;
#if CONFIG_BACKLIGHT
#ifdef HAVE_BACKLIGHT
static bool skip_release = false;
#ifdef HAVE_REMOTE_LCD
static bool skip_remote_release = false;
@ -121,7 +121,7 @@ static void button_tick(void)
diff = btn ^ lastbtn;
if(diff && (btn & diff) == 0)
{
#if CONFIG_BACKLIGHT
#ifdef HAVE_BACKLIGHT
#ifdef HAVE_REMOTE_LCD
if(diff & BUTTON_REMOTE)
if(!skip_remote_release)
@ -211,7 +211,7 @@ static void button_tick(void)
if (queue_empty(&button_queue))
{
queue_post(&button_queue, BUTTON_REPEAT | btn, 0);
#if CONFIG_BACKLIGHT
#ifdef HAVE_BACKLIGHT
#ifdef HAVE_REMOTE_LCD
skip_remote_release = false;
#endif
@ -222,7 +222,7 @@ static void button_tick(void)
}
else
{
#if CONFIG_BACKLIGHT
#ifdef HAVE_BACKLIGHT
#ifdef HAVE_REMOTE_LCD
if (btn & BUTTON_REMOTE) {
if (!remote_filter_first_keypress || is_remote_backlight_on()
@ -347,7 +347,7 @@ void button_init(void)
#ifdef HAVE_LCD_BITMAP
flipped = false;
#endif
#if CONFIG_BACKLIGHT
#ifdef HAVE_BACKLIGHT
filter_first_keypress = false;
#ifdef HAVE_REMOTE_LCD
remote_filter_first_keypress = false;
@ -419,7 +419,7 @@ void button_set_flip(bool flip)
}
#endif /* HAVE_LCD_BITMAP */
#if CONFIG_BACKLIGHT
#ifdef HAVE_BACKLIGHT
void set_backlight_filter_keypress(bool value)
{
filter_first_keypress = value;

View file

@ -26,7 +26,7 @@ void backlight_on(void);
void backlight_off(void);
void backlight_set_timeout(int index);
#if CONFIG_BACKLIGHT
#ifdef HAVE_BACKLIGHT
void backlight_init(void);
#if defined(IAUDIO_X5) && !defined(SIMULATOR)
@ -54,9 +54,9 @@ void lcd_set_sleep_after_backlight_off(int index);
extern const signed char lcd_sleep_timeout_value[];
#endif
#else /* CONFIG_BACKLIGHT == 0 */
#else /* !HAVE_BACKLIGHT */
#define backlight_init()
#endif /* CONFIG_BACKLIGHT */
#endif /* !HAVE_BACKLIGHT */
#ifdef HAVE_REMOTE_LCD
void remote_backlight_on(void);

View file

@ -33,7 +33,7 @@ void button_clear_queue(void);
#ifdef HAVE_LCD_BITMAP
void button_set_flip(bool flip); /* turn 180 degrees */
#endif
#if CONFIG_BACKLIGHT
#ifdef HAVE_BACKLIGHT
void set_backlight_filter_keypress(bool value);
#ifdef HAVE_REMOTE_LCD
void set_remote_backlight_filter_keypress(bool value);

View file

@ -69,8 +69,7 @@
#define CONFIG_TUNER_XTAL 32768 *//* TODO: what is this? */
/* Define this for LCD backlight available */
#define CONFIG_BACKLIGHT BL_H10 /* TODO: figure this out, probably not necessary
because of 'target' stuff */
#define HAVE_BACKLIGHT
#define BATTERY_CAPACITY_DEFAULT 750 /* default battery capacity */

View file

@ -52,7 +52,7 @@
#define HAVE_SPDIF_IN
/* Define this for LCD backlight available */
#define CONFIG_BACKLIGHT BL_RTC /* on I2C controlled RTC port */
#define HAVE_BACKLIGHT
#define CONFIG_I2C I2C_PLAYREC

View file

@ -42,7 +42,7 @@
#define CONFIG_RTC RTC_S3C2440
/* Define this for LCD backlight available */
#define CONFIG_BACKLIGHT BL_GIGABEAT /* port controlled PWM */
#define HAVE_BACKLIGHT
#define HAVE_LCD_ENABLE

View file

@ -78,8 +78,7 @@
#define CONFIG_TUNER_XTAL 32768 *//* TODO: what is this? */
/* Define this for LCD backlight available */
#define CONFIG_BACKLIGHT BL_H10 /* TODO: figure this out, probably not necessary
because of 'target' stuff */
#define HAVE_BACKLIGHT
#define BATTERY_CAPACITY_DEFAULT 1550 /* default battery capacity */

View file

@ -56,7 +56,7 @@
#define CONFIG_LCD LCD_S1D15E06
/* Define this for LCD backlight available */
#define CONFIG_BACKLIGHT BL_IRIVER_H100 /* port controlled */
#define HAVE_BACKLIGHT
/* We can fade the backlight by using PWM */
#define HAVE_BACKLIGHT_PWM_FADING

View file

@ -72,8 +72,7 @@
#define CONFIG_TUNER_XTAL 32768 *//* TODO: what is this? */
/* Define this for LCD backlight available */
#define CONFIG_BACKLIGHT BL_H10 /* TODO: figure this out, probably not necessary
because of target tree stuff */
#define HAVE_BACKLIGHT
#define BATTERY_CAPACITY_DEFAULT 820 /* default battery capacity */

View file

@ -51,7 +51,7 @@
#define CONFIG_LCD LCD_S1D15E06
/* Define this for LCD backlight available */
#define CONFIG_BACKLIGHT BL_IRIVER_H100 /* port controlled */
#define HAVE_BACKLIGHT
/* We can fade the backlight by using PWM */
#define HAVE_BACKLIGHT_PWM_FADING

View file

@ -51,7 +51,7 @@
#define HAVE_REMOTE_LCD
/* Define this for LCD backlight available */
#define CONFIG_BACKLIGHT BL_IRIVER_H300 /* port controlled PWM */
#define HAVE_BACKLIGHT
/* Define this if you have a software controlled poweroff */
#define HAVE_SW_POWEROFF

View file

@ -64,7 +64,7 @@
#define CONFIG_LCD LCD_S1D15E06
/* Define this for LCD backlight available */
#define CONFIG_BACKLIGHT BL_M5 /* PCF50606 I2C */
#define HAVE_BACKLIGHT
/* Define this if you have a software controlled poweroff */
#define HAVE_SW_POWEROFF

View file

@ -66,7 +66,7 @@
#define CONFIG_LCD LCD_X5
/* Define this for LCD backlight available */
#define CONFIG_BACKLIGHT BL_X5 /* PCF50606 I2C */
#define HAVE_BACKLIGHT
#define HAVE_BACKLIGHT_BRIGHTNESS
/* Define this if you have a software controlled poweroff */

View file

@ -77,7 +77,7 @@
#define ROM_START 0x00000000
/* Define this for LCD backlight available */
#define CONFIG_BACKLIGHT BL_IRIVER_IFP7XX /* port controlled */
#define HAVE_BACKLIGHT
/* Define this to the CPU frequency */
#define CPU_FREQ 48000000

View file

@ -64,7 +64,7 @@
#define HAVE_SW_TONE_CONTROLS
/* Define this for LCD backlight available */
#define CONFIG_BACKLIGHT BL_IPOD3G /* port controlled */
#define HAVE_BACKLIGHT
#define BATTERY_CAPACITY_DEFAULT 630 /* default battery capacity */

View file

@ -70,7 +70,7 @@
#define ACTION_WPSAB_SINGLE ACTION_WPS_BROWSE
/* Define this for LCD backlight available */
#define CONFIG_BACKLIGHT BL_IPOD4G /* port controlled */
#define HAVE_BACKLIGHT
#define BATTERY_CAPACITY_DEFAULT 630 /* default battery capacity */

View file

@ -61,7 +61,7 @@
#define ACTION_WPSAB_SINGLE ACTION_WPS_BROWSE
/* Define this for LCD backlight available */
#define CONFIG_BACKLIGHT BL_IPOD4G /* port controlled */
#define HAVE_BACKLIGHT
#define BATTERY_CAPACITY_DEFAULT 700 /* default battery capacity */

View file

@ -67,7 +67,7 @@
#define ACTION_WPSAB_SINGLE ACTION_WPS_BROWSE
/* Define this for LCD backlight available */
#define CONFIG_BACKLIGHT BL_IPODMINI /* port controlled */
#define HAVE_BACKLIGHT
#define BATTERY_CAPACITY_DEFAULT 400 /* default battery capacity */

View file

@ -67,7 +67,7 @@
#define ACTION_WPSAB_SINGLE ACTION_WPS_BROWSE
/* Define this for LCD backlight available */
#define CONFIG_BACKLIGHT BL_IPODMINI /* port controlled */
#define HAVE_BACKLIGHT
/* We can fade the backlight by using PWM */
#define HAVE_BACKLIGHT_PWM_FADING

View file

@ -61,7 +61,7 @@
#define ACTION_WPSAB_SINGLE ACTION_WPS_BROWSE
/* Define this for LCD backlight available */
#define CONFIG_BACKLIGHT BL_IPODNANO /* port controlled */
#define HAVE_BACKLIGHT
/* We can fade the backlight by using PWM */
#define HAVE_BACKLIGHT_PWM_FADING

View file

@ -61,7 +61,7 @@
#define ACTION_WPSAB_SINGLE ACTION_WPS_BROWSE
/* Define this for LCD backlight available */
#define CONFIG_BACKLIGHT BL_IPODNANO /* port controlled */
#define HAVE_BACKLIGHT
/* We can fade the backlight by using PWM */
#define HAVE_BACKLIGHT_PWM_FADING

View file

@ -40,7 +40,7 @@
#define CONFIG_CODEC MAS3587F
/* Enable this if you have done the backlight mod */
//#define CONFIG_BACKLIGHT BL_PA14_HI
//#define HAVE_BACKLIGHT
#define BATTERY_CAPACITY_DEFAULT 1000 /* default battery capacity */

View file

@ -33,7 +33,7 @@
#define CONFIG_CODEC MAS3539F
/* Enable this if you have done the backlight mod */
//#define CONFIG_BACKLIGHT BL_PA14_HI
//#define HAVE_BACKLIGHT
#define BATTERY_CAPACITY_DEFAULT 1000 /* default battery capacity */

View file

@ -25,7 +25,7 @@
#define HAVE_DAC3550A
/* Define this for LCD backlight available */
#define CONFIG_BACKLIGHT BL_PA14_LO /* port PA14, low active */
#define HAVE_BACKLIGHT
#define BATTERY_CAPACITY_DEFAULT 1500 /* default battery capacity */

View file

@ -46,7 +46,7 @@
#define HAVE_SPDIF_IN
/* Define this for LCD backlight available */
#define CONFIG_BACKLIGHT BL_RTC /* on I2C controlled RTC port */
#define HAVE_BACKLIGHT
#define CONFIG_I2C I2C_PLAYREC

View file

@ -49,7 +49,7 @@
#define HAVE_SPDIF_IN
/* Define this for LCD backlight available */
#define CONFIG_BACKLIGHT BL_RTC /* on I2C controlled RTC port */
#define HAVE_BACKLIGHT
#define CONFIG_I2C I2C_PLAYREC

View file

@ -55,8 +55,7 @@
#define AB_REPEAT_ENABLE 1
/* Define this for LCD backlight available */
#define CONFIG_BACKLIGHT BL_TPJ1022 /* TODO: figure this out, probably not necessary
because of 'target' stuff */
#define HAVE_BACKLIGHT
#define BATTERY_CAPACITY_DEFAULT 1550 /* default battery capacity
TODO: check this, probably different

View file

@ -113,24 +113,6 @@
#define RGB565 565
#define RGB565SWAPPED 3553
/* CONFIG_BACKLIGHT */
#define BL_PA14_LO 1 /* Player, PA14 low active */
#define BL_RTC 2 /* Recorder, RTC square wave output */
#define BL_PA14_HI 3 /* Ondio, PA14 high active */
#define BL_IRIVER_H100 4 /* IRiver GPIO */
#define BL_IPOD4G 5 /* Apple iPod 4G */
#define BL_IPODNANO 6 /* Apple iPod Nano and iPod Video*/
#define BL_IPOD3G 7 /* Apple iPod 3g with dock */
#define BL_IRIVER_H300 8 /* IRiver PWM */
#define BL_IRIVER_IFP7XX 9 /* IRiver GPIO */
#define BL_IPODMINI 10 /* Apple iPod Mini */
#define BL_GIGABEAT 11 /* Toshiba Gigabeat */
#define BL_H10 12 /* iriver H10 */
#define BL_X5 13 /* iAudio X5 PCF50606 I2C */
#define BL_H10_5GB 14 /* iriver H10 5/6GB */
#define BL_TPJ1022 15 /* Tatung Elio TPJ-1022 */
#define BL_M5 16 /* iAudio M5 PCF50606 I2C */
/* CONFIG_I2C */
#define I2C_PLAYREC 1 /* Archos Player/Recorder style */
#define I2C_ONDIO 2 /* Ondio style */
@ -235,10 +217,6 @@
#define CONFIG_LED 0
#endif
#ifndef CONFIG_BACKLIGHT
#define CONFIG_BACKLIGHT 0
#endif
#ifndef CONFIG_CHARGING
#define CONFIG_CHARGING 0
#endif

View file

@ -708,7 +708,7 @@ static int runcurrent(void)
current = CURRENT_USB;
}
#if CONFIG_BACKLIGHT && !defined(BOOTLOADER)
#if defined(HAVE_BACKLIGHT) && !defined(BOOTLOADER)
if (backlight_get_current_timeout() == 0) /* LED always on */
current += CURRENT_BACKLIGHT;
#endif

View file

@ -19,6 +19,7 @@
#ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H
#define __backlight_init() true
void __backlight_on(void);
void __backlight_off(void);

View file

@ -19,6 +19,7 @@
#ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H
#define __backlight_init() true
void __backlight_on(void);
void __backlight_off(void);

View file

@ -19,6 +19,7 @@
#ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H
#define __backlight_init() true
void __backlight_on(void);
void __backlight_off(void);
void __backlight_set_brightness(int brightness);

View file

@ -22,6 +22,7 @@
#ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H
#define __backlight_init() true
void __backlight_on(void);
void __backlight_off(void);

View file

@ -19,7 +19,6 @@
#ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H
#define __BACKLIGHT_INIT
bool __backlight_init(void);
void __backlight_on(void);
void __backlight_off(void);

View file

@ -19,7 +19,6 @@
#ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H
#define __BACKLIGHT_INIT
bool __backlight_init(void);
void __backlight_on(void);
void __backlight_off(void);

View file

@ -19,7 +19,6 @@
#ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H
#define __BACKLIGHT_INIT
bool __backlight_init(void); /* Returns backlight current state (true=ON). */
void __backlight_on(void);
void __backlight_off(void);

View file

@ -0,0 +1,39 @@
/***************************************************************************
* __________ __ ___.
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
* \/ \/ \/ \/ \/
* $Id$
*
* Copyright (C) 2007 by Jens Arnold
*
* 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.
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
****************************************************************************/
#ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H
#include "config.h"
#include "rtc.h"
#define __backlight_init() true
static inline void __backlight_on(void)
{
/* Enable square wave */
rtc_write(0x0a, rtc_read(0x0a) | 0x40);
}
static inline void __backlight_off(void)
{
/* Disable square wave */
rtc_write(0x0a, rtc_read(0x0a) & ~0x40);
}
#endif

View file

@ -0,0 +1,47 @@
/***************************************************************************
* __________ __ ___.
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
* \/ \/ \/ \/ \/
* $Id$
*
* Copyright (C) 2007 by Jens Arnold
*
* 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.
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
****************************************************************************/
#ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H
#include "config.h"
#include "cpu.h"
#ifdef HAVE_BACKLIGHT
/* A stock Ondio has no backlight, it needs a hardware mod. */
static inline bool __backlight_init(void)
{
PACR1 &= ~0x3000; /* Set PA14 (backlight control) to GPIO */
or_b(0x40, &PADRH); /* drive it high */
or_b(0x40, &PAIORH); /* ..and output */
return true;
}
static inline void __backlight_on(void)
{
or_b(0x40, &PADRH); /* drive it high */
}
static inline void __backlight_off(void)
{
and_b(~0x40, &PADRH); /* drive it low */
}
#endif /* HAVE_BACKLIGHT */
#endif

View file

@ -0,0 +1,44 @@
/***************************************************************************
* __________ __ ___.
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
* \/ \/ \/ \/ \/
* $Id$
*
* Copyright (C) 2007 by Jens Arnold
*
* 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.
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
****************************************************************************/
#ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H
#include "config.h"
#include "cpu.h"
static inline bool __backlight_init(void)
{
PACR1 &= ~0x3000; /* Set PA14 (backlight control) to GPIO */
and_b(~0x40, &PADRH); /* drive and set low */
or_b(0x40, &PAIORH); /* ..and output */
return true;
}
static inline void __backlight_on(void)
{
and_b(~0x40, &PADRH); /* drive and set low */
or_b(0x40, &PAIORH);
}
static inline void __backlight_off(void)
{
and_b(~0x40, &PAIORH); /* let it float (up) */
}
#endif

View file

@ -0,0 +1,39 @@
/***************************************************************************
* __________ __ ___.
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
* \/ \/ \/ \/ \/
* $Id$
*
* Copyright (C) 2007 by Jens Arnold
*
* 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.
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
****************************************************************************/
#ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H
#include "config.h"
#include "rtc.h"
#define __backlight_init() true
static inline void __backlight_on(void)
{
/* Enable square wave */
rtc_write(0x0a, rtc_read(0x0a) | 0x40);
}
static inline void __backlight_off(void)
{
/* Disable square wave */
rtc_write(0x0a, rtc_read(0x0a) & ~0x40);
}
#endif

View file

@ -49,7 +49,7 @@ struct event_queue button_queue;
static int btn = 0; /* Hopefully keeps track of currently pressed keys... */
#if CONFIG_BACKLIGHT
#ifdef HAVE_BACKLIGHT
static bool filter_first_keypress;
void set_backlight_filter_keypress(bool value)
@ -90,7 +90,7 @@ void button_event(int key, bool pressed)
static int repeat_count = 0;
static bool repeat = false;
static bool post = false;
#if CONFIG_BACKLIGHT
#ifdef HAVE_BACKLIGHT
static bool skip_release = false;
#ifdef HAVE_REMOTE_LCD
static bool skip_remote_release = false;
@ -568,7 +568,7 @@ void button_event(int key, bool pressed)
diff = btn ^ lastbtn;
if(diff && (btn & diff) == 0)
{
#if CONFIG_BACKLIGHT
#ifdef HAVE_BACKLIGHT
#ifdef HAVE_REMOTE_LCD
if(diff & BUTTON_REMOTE)
if(!skip_remote_release)
@ -635,7 +635,7 @@ void button_event(int key, bool pressed)
if (queue_empty(&button_queue))
{
queue_post(&button_queue, BUTTON_REPEAT | btn, 0);
#if CONFIG_BACKLIGHT
#ifdef HAVE_BACKLIGHT
#ifdef HAVE_REMOTE_LCD
if(btn & BUTTON_REMOTE)
{
@ -652,7 +652,7 @@ void button_event(int key, bool pressed)
}
else
{
#if CONFIG_BACKLIGHT
#ifdef HAVE_BACKLIGHT
#ifdef HAVE_REMOTE_LCD
if (btn & BUTTON_REMOTE) {
if (!remote_filter_first_keypress || is_remote_backlight_on())

View file

@ -25,7 +25,7 @@ SDL_Surface* lcd_surface;
int lcd_backlight_val;
#if LCD_DEPTH <= 8
#if CONFIG_BACKLIGHT
#ifdef HAVE_BACKLIGHT
SDL_Color lcd_backlight_color_zero = {UI_LCD_BGCOLORLIGHT, 0};
#endif
SDL_Color lcd_color_zero = {UI_LCD_BGCOLOR, 0};
@ -71,7 +71,7 @@ void lcd_update_rect(int x_start, int y_start, int width, int height)
LCD_HEIGHT, background ? UI_LCD_POSX : 0, background? UI_LCD_POSY : 0);
}
#if CONFIG_BACKLIGHT
#ifdef HAVE_BACKLIGHT
void sim_backlight(int value)
{
lcd_backlight_val = value;
@ -116,7 +116,7 @@ void sim_lcd_init(void)
#endif
#if LCD_DEPTH <= 8
#if CONFIG_BACKLIGHT
#ifdef HAVE_BACKLIGHT
sdl_set_gradient(lcd_surface, &lcd_backlight_color_zero, &lcd_color_max,
0, (1<<LCD_DEPTH));
#else
@ -132,7 +132,7 @@ void sim_lcd_ex_init(int shades, unsigned long (*getpixel)(int, int))
lcd_ex_shades = shades;
lcd_ex_getpixel = getpixel;
if (shades) {
#if CONFIG_BACKLIGHT
#ifdef HAVE_BACKLIGHT
if (lcd_backlight_val > 0) {
sdl_set_gradient(lcd_surface, &lcd_color_max,
&lcd_backlight_color_zero, (1<<LCD_DEPTH),

View file

@ -71,7 +71,7 @@ void lcd_update(void)
LCD_HEIGHT*CHAR_HEIGHT*CHAR_PIXEL);
}
#if CONFIG_BACKLIGHT
#ifdef HAVE_BACKLIGHT
void sim_backlight(int value)
{
if (value > 0) {