forked from len0rd/rockbox
multiple choice configuration CONFIG_BACKLIGHT instead of HAVE_BACKLIGHT, allows better control of how to do this per model
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5491 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
417753da7d
commit
fee8617479
10 changed files with 44 additions and 34 deletions
|
|
@ -182,12 +182,14 @@ static const struct bit_entry rtc_bits[] =
|
||||||
{2, S_O(repeat_mode), REPEAT_ALL, "repeat", "off,all,one" },
|
{2, S_O(repeat_mode), REPEAT_ALL, "repeat", "off,all,one" },
|
||||||
/* LCD */
|
/* LCD */
|
||||||
{6, S_O(contrast), 40, "contrast", NULL },
|
{6, S_O(contrast), 40, "contrast", NULL },
|
||||||
#ifdef HAVE_BACKLIGHT
|
#ifdef CONFIG_BACKLIGHT
|
||||||
|
#ifdef HAVE_CHARGING
|
||||||
{1, S_O(backlight_on_when_charging), false,
|
{1, S_O(backlight_on_when_charging), false,
|
||||||
"backlight when plugged", off_on },
|
"backlight when plugged", off_on },
|
||||||
|
#endif
|
||||||
{5, S_O(backlight_timeout), 5, "backlight timeout",
|
{5, S_O(backlight_timeout), 5, "backlight timeout",
|
||||||
"off,on,1,2,3,4,5,6,7,8,9,10,15,20,25,30,45,60,90" },
|
"off,on,1,2,3,4,5,6,7,8,9,10,15,20,25,30,45,60,90" },
|
||||||
#endif
|
#endif /* CONFIG_BACKLIGHT */
|
||||||
#ifdef HAVE_LCD_BITMAP
|
#ifdef HAVE_LCD_BITMAP
|
||||||
{1, S_O(invert), false, "invert", off_on },
|
{1, S_O(invert), false, "invert", off_on },
|
||||||
{1, S_O(flip_display), false, "flip display", off_on },
|
{1, S_O(flip_display), false, "flip display", off_on },
|
||||||
|
|
@ -247,7 +249,7 @@ static const struct bit_entry hd_bits[] =
|
||||||
|
|
||||||
/* # of bits, offset+size, default, .cfg name, .cfg values */
|
/* # of bits, offset+size, default, .cfg name, .cfg values */
|
||||||
/* more display */
|
/* more display */
|
||||||
#ifdef HAVE_BACKLIGHT
|
#ifdef CONFIG_BACKLIGHT
|
||||||
{1, S_O(caption_backlight), false, "caption backlight", off_on },
|
{1, S_O(caption_backlight), false, "caption backlight", off_on },
|
||||||
#endif
|
#endif
|
||||||
{4, S_O(scroll_speed), 9, "scroll speed", NULL }, /* 0...15 */
|
{4, S_O(scroll_speed), 9, "scroll speed", NULL }, /* 0...15 */
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,7 @@ static bool contrast(void)
|
||||||
MAX_CONTRAST_SETTING );
|
MAX_CONTRAST_SETTING );
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_BACKLIGHT
|
#ifdef CONFIG_BACKLIGHT
|
||||||
static bool caption_backlight(void)
|
static bool caption_backlight(void)
|
||||||
{
|
{
|
||||||
bool rc = set_bool( str(LANG_CAPTION_BACKLIGHT),
|
bool rc = set_bool( str(LANG_CAPTION_BACKLIGHT),
|
||||||
|
|
@ -575,7 +575,8 @@ static bool useMRB(void)
|
||||||
names, 3, NULL );
|
names, 3, NULL );
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_BACKLIGHT
|
#ifdef CONFIG_BACKLIGHT
|
||||||
|
#ifdef HAVE_CHARGING
|
||||||
static bool backlight_on_when_charging(void)
|
static bool backlight_on_when_charging(void)
|
||||||
{
|
{
|
||||||
bool result = set_bool(str(LANG_BACKLIGHT_ON_WHEN_CHARGING),
|
bool result = set_bool(str(LANG_BACKLIGHT_ON_WHEN_CHARGING),
|
||||||
|
|
@ -583,6 +584,7 @@ static bool backlight_on_when_charging(void)
|
||||||
backlight_set_on_when_charging(global_settings.backlight_on_when_charging);
|
backlight_set_on_when_charging(global_settings.backlight_on_when_charging);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static bool backlight_timer(void)
|
static bool backlight_timer(void)
|
||||||
{
|
{
|
||||||
|
|
@ -610,7 +612,7 @@ static bool backlight_timer(void)
|
||||||
return set_option(str(LANG_BACKLIGHT), &global_settings.backlight_timeout,
|
return set_option(str(LANG_BACKLIGHT), &global_settings.backlight_timeout,
|
||||||
INT, names, 19, backlight_set_timeout );
|
INT, names, 19, backlight_set_timeout );
|
||||||
}
|
}
|
||||||
#endif /* HAVE_BACKLIGHT */
|
#endif /* CONFIG_BACKLIGHT */
|
||||||
|
|
||||||
static bool poweroff_idle_timer(void)
|
static bool poweroff_idle_timer(void)
|
||||||
{
|
{
|
||||||
|
|
@ -1162,11 +1164,13 @@ static bool lcd_settings_menu(void)
|
||||||
bool result;
|
bool result;
|
||||||
|
|
||||||
static const struct menu_item items[] = {
|
static const struct menu_item items[] = {
|
||||||
#ifdef HAVE_BACKLIGHT
|
#ifdef CONFIG_BACKLIGHT
|
||||||
{ ID2P(LANG_BACKLIGHT), backlight_timer },
|
{ ID2P(LANG_BACKLIGHT), backlight_timer },
|
||||||
|
#ifdef HAVE_CHARGING
|
||||||
{ ID2P(LANG_BACKLIGHT_ON_WHEN_CHARGING), backlight_on_when_charging },
|
{ ID2P(LANG_BACKLIGHT_ON_WHEN_CHARGING), backlight_on_when_charging },
|
||||||
{ ID2P(LANG_CAPTION_BACKLIGHT), caption_backlight },
|
|
||||||
#endif
|
#endif
|
||||||
|
{ ID2P(LANG_CAPTION_BACKLIGHT), caption_backlight },
|
||||||
|
#endif /* CONFIG_BACKLIGHT */
|
||||||
{ ID2P(LANG_CONTRAST), contrast },
|
{ ID2P(LANG_CONTRAST), contrast },
|
||||||
#ifdef HAVE_LCD_BITMAP
|
#ifdef HAVE_LCD_BITMAP
|
||||||
{ ID2P(LANG_INVERT), invert },
|
{ ID2P(LANG_INVERT), invert },
|
||||||
|
|
|
||||||
|
|
@ -987,7 +987,7 @@ bool wps_refresh(struct mp3entry* id3,
|
||||||
peak_meter_enabled = enable_pm;
|
peak_meter_enabled = enable_pm;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(HAVE_BACKLIGHT) && !defined(SIMULATOR)
|
#if defined(CONFIG_BACKLIGHT) && !defined(SIMULATOR)
|
||||||
if (global_settings.caption_backlight && id3) {
|
if (global_settings.caption_backlight && id3) {
|
||||||
/* turn on backlight n seconds before track ends, and turn it off n
|
/* turn on backlight n seconds before track ends, and turn it off n
|
||||||
seconds into the new track. n == backlight_timeout, or 5s */
|
seconds into the new track. n == backlight_timeout, or 5s */
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@
|
||||||
#include "power.h"
|
#include "power.h"
|
||||||
#include "system.h"
|
#include "system.h"
|
||||||
|
|
||||||
#ifdef HAVE_BACKLIGHT
|
#ifdef CONFIG_BACKLIGHT
|
||||||
|
|
||||||
const char backlight_timeout_value[19] =
|
const char backlight_timeout_value[19] =
|
||||||
{
|
{
|
||||||
|
|
@ -51,30 +51,30 @@ static unsigned int backlight_timeout = 5;
|
||||||
|
|
||||||
static void __backlight_off(void)
|
static void __backlight_off(void)
|
||||||
{
|
{
|
||||||
#ifdef IRIVER_H100
|
#if CONFIG_BACKLIGHT == BL_IRIVER
|
||||||
GPIO1_OUT |= 0x00020000;
|
GPIO1_OUT |= 0x00020000;
|
||||||
#else
|
#elif CONFIG_BACKLIGHT == BL_RTC
|
||||||
#ifdef HAVE_RTC
|
|
||||||
/* Disable square wave */
|
/* Disable square wave */
|
||||||
rtc_write(0x0a, rtc_read(0x0a) & ~0x40);
|
rtc_write(0x0a, rtc_read(0x0a) & ~0x40);
|
||||||
#else
|
#elif CONFIG_BACKLIGHT == BL_PA14_LO /* Player */
|
||||||
and_b(~0x40, &PAIORH);
|
and_b(~0x40, &PAIORH); /* let it float (up) */
|
||||||
#endif
|
#elif CONFIG_BACKLIGHT == BL_PA14_HI /* Ondio */
|
||||||
|
and_b(~0x40, &PADRH); /* drive it low */
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void __backlight_on(void)
|
static void __backlight_on(void)
|
||||||
{
|
{
|
||||||
#ifdef IRIVER_H100
|
#if CONFIG_BACKLIGHT == BL_IRIVER
|
||||||
GPIO1_OUT &= ~0x00020000;
|
GPIO1_OUT &= ~0x00020000;
|
||||||
#else
|
#elif CONFIG_BACKLIGHT == BL_RTC
|
||||||
#ifdef HAVE_RTC
|
|
||||||
/* Enable square wave */
|
/* Enable square wave */
|
||||||
rtc_write(0x0a, rtc_read(0x0a) | 0x40);
|
rtc_write(0x0a, rtc_read(0x0a) | 0x40);
|
||||||
#else
|
#elif CONFIG_BACKLIGHT == BL_PA14_LO /* Player */
|
||||||
and_b(~0x40, &PADRH);
|
and_b(~0x40, &PADRH); /* drive an set low */
|
||||||
or_b(0x40, &PAIORH);
|
or_b(0x40, &PAIORH);
|
||||||
#endif
|
#elif CONFIG_BACKLIGHT == BL_PA14_HI /* Ondio */
|
||||||
|
or_b(0x40, &PADRH); /* drive it high */
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -187,15 +187,13 @@ void backlight_init(void)
|
||||||
create_thread(backlight_thread, backlight_stack,
|
create_thread(backlight_thread, backlight_stack,
|
||||||
sizeof(backlight_stack), backlight_thread_name);
|
sizeof(backlight_stack), backlight_thread_name);
|
||||||
|
|
||||||
#ifdef HAVE_LCD_CHARCELLS
|
#if CONFIG_BACKLIGHT == BL_IRIVER
|
||||||
|
GPIO1_ENABLE |= 0x00020000;
|
||||||
|
GPIO1_FUNCTION |= 0x00020000;
|
||||||
|
#elif CONFIG_BACKLIGHT == BL_PA14_LO || CONFIG_BACKLIGHT == BL_PA14_HI
|
||||||
PACR1 &= ~0x3000; /* Set PA14 (backlight control) to GPIO */
|
PACR1 &= ~0x3000; /* Set PA14 (backlight control) to GPIO */
|
||||||
or_b(0x40, &PAIORH); /* ..and output */
|
or_b(0x40, &PAIORH); /* ..and output */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef IRIVER_H100
|
|
||||||
GPIO1_ENABLE |= 0x00020000;
|
|
||||||
GPIO1_FUNCTION |= 0x00020000;
|
|
||||||
#endif
|
|
||||||
backlight_on();
|
backlight_on();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -210,5 +208,5 @@ void backlight_set_timeout(int index) {(void)index;}
|
||||||
bool backlight_get_on_when_charging(void) {return 0;}
|
bool backlight_get_on_when_charging(void) {return 0;}
|
||||||
void backlight_set_on_when_charging(bool yesno) {(void)yesno;}
|
void backlight_set_on_when_charging(bool yesno) {(void)yesno;}
|
||||||
|
|
||||||
#endif /* #ifdef HAVE_BACKLIGHT */
|
#endif /* #ifdef CONFIG_BACKLIGHT */
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,7 @@
|
||||||
#define HAVE_LED
|
#define HAVE_LED
|
||||||
|
|
||||||
/* Define this for LCD backlight available */
|
/* Define this for LCD backlight available */
|
||||||
#define HAVE_BACKLIGHT
|
#define CONFIG_BACKLIGHT BL_RTC /* on I2C controlled RTC port */
|
||||||
|
|
||||||
/* Define this if you have a software controlled poweroff */
|
/* Define this if you have a software controlled poweroff */
|
||||||
#define HAVE_SW_POWEROFF
|
#define HAVE_SW_POWEROFF
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@
|
||||||
#define ROM_START 0x11010
|
#define ROM_START 0x11010
|
||||||
|
|
||||||
/* Define this for LCD backlight available */
|
/* Define this for LCD backlight available */
|
||||||
#define HAVE_BACKLIGHT
|
#define CONFIG_BACKLIGHT BL_IRIVER /* port controlled */
|
||||||
|
|
||||||
/* Define this to the CPU frequency */
|
/* Define this to the CPU frequency */
|
||||||
#define CPU_FREQ 11289600
|
#define CPU_FREQ 11289600
|
||||||
|
|
|
||||||
|
|
@ -64,6 +64,6 @@
|
||||||
#define HAVE_LED
|
#define HAVE_LED
|
||||||
|
|
||||||
/* Define this for LCD backlight available */
|
/* Define this for LCD backlight available */
|
||||||
#define HAVE_BACKLIGHT
|
#define CONFIG_BACKLIGHT BL_PA14_LO /* port PA14, low active */
|
||||||
|
|
||||||
#endif /* SIMULATOR */
|
#endif /* SIMULATOR */
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@
|
||||||
#define HAVE_LED
|
#define HAVE_LED
|
||||||
|
|
||||||
/* Define this for LCD backlight available */
|
/* Define this for LCD backlight available */
|
||||||
#define HAVE_BACKLIGHT
|
#define CONFIG_BACKLIGHT BL_RTC /* on I2C controlled RTC port */
|
||||||
|
|
||||||
/* Define this for S/PDIF output available */
|
/* Define this for S/PDIF output available */
|
||||||
#define HAVE_SPDIF_OUT
|
#define HAVE_SPDIF_OUT
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,7 @@
|
||||||
#define HAVE_LED
|
#define HAVE_LED
|
||||||
|
|
||||||
/* Define this for LCD backlight available */
|
/* Define this for LCD backlight available */
|
||||||
#define HAVE_BACKLIGHT
|
#define CONFIG_BACKLIGHT BL_RTC /* on I2C controlled RTC port */
|
||||||
|
|
||||||
/* Define this if you have a software controlled poweroff */
|
/* Define this if you have a software controlled poweroff */
|
||||||
#define HAVE_SW_POWEROFF
|
#define HAVE_SW_POWEROFF
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,12 @@
|
||||||
#define BATT_4AA_NIMH 1500
|
#define BATT_4AA_NIMH 1500
|
||||||
#define BATT_3AAA_ALKALINE 1000
|
#define BATT_3AAA_ALKALINE 1000
|
||||||
|
|
||||||
|
/* CONFIG_BACKLIGHT */
|
||||||
|
#define BL_PA14_LO 0 /* Player, PA14 low active */
|
||||||
|
#define BL_RTC 1 /* Recorder, RTC square wave output */
|
||||||
|
#define BL_PA14_HI 2 /* Ondio, PA14 high active */
|
||||||
|
#define BL_IRIVER 3 /* IRiver GPIO */
|
||||||
|
|
||||||
/* now go and pick yours */
|
/* now go and pick yours */
|
||||||
#if defined(ARCHOS_PLAYER)
|
#if defined(ARCHOS_PLAYER)
|
||||||
#include "config-player.h"
|
#include "config-player.h"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue