1
0
Fork 0
forked from len0rd/rockbox

fixed for player, removed dependency on CHARGER_CTRL

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2465 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Daniel Stenberg 2002-10-01 11:06:22 +00:00
parent b95fe1afc6
commit ad19f6f912

View file

@ -35,10 +35,8 @@ static char backlight_stack[DEFAULT_STACK_SIZE];
static char backlight_thread_name[] = "backlight";
static struct event_queue backlight_queue;
#ifdef HAVE_CHARGE_CTRL
static bool charger_was_inserted = 0;
static bool backlight_on_when_charging = 0;
#endif
static int backlight_timer;
static int backlight_timeout = 5;
@ -58,7 +56,6 @@ void backlight_thread(void)
switch(ev.id)
{
case BACKLIGHT_ON:
#ifdef HAVE_CHARGE_CTRL
if( backlight_on_when_charging && charger_inserted() )
{
/* Forcing to zero keeps the lights on */
@ -68,9 +65,9 @@ void backlight_thread(void)
{
backlight_timer = HZ*timeout_value[backlight_timeout];
}
#else
backlight_timer = HZ*timeout_value[backlight_timeout];
#endif
if(backlight_timer < 0)
{
backlight_timer = 0; /* timer value 0 will not get ticked */
@ -139,14 +136,14 @@ void backlight_set_on_when_charging(bool yesno)
void backlight_tick(void)
{
#ifdef HAVE_CHARGE_CTRL
bool charger_is_inserted = charger_inserted();
if( backlight_on_when_charging && (charger_was_inserted != charger_is_inserted) )
if( backlight_on_when_charging &&
(charger_was_inserted != charger_is_inserted) )
{
backlight_on();
}
charger_was_inserted = charger_is_inserted;
#endif
if(backlight_timer)
{
backlight_timer--;