mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-10 13:42:29 -05:00
Few more code cleanups to the button light work. This reduces the flickering of the backlight when a button is held (fewer sc606 writes).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13355 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
7ef0af07f1
commit
830576bb0b
1 changed files with 14 additions and 11 deletions
|
|
@ -55,16 +55,9 @@ static enum sc606_states
|
||||||
enum buttonlight_states
|
enum buttonlight_states
|
||||||
{
|
{
|
||||||
BUTTONLIGHT_CONTROL_IDLE,
|
BUTTONLIGHT_CONTROL_IDLE,
|
||||||
|
|
||||||
/* turn button lights off */
|
|
||||||
BUTTONLIGHT_CONTROL_OFF,
|
BUTTONLIGHT_CONTROL_OFF,
|
||||||
|
|
||||||
/* turns button lights on to setting */
|
|
||||||
BUTTONLIGHT_CONTROL_ON,
|
BUTTONLIGHT_CONTROL_ON,
|
||||||
|
|
||||||
/* buttonlights follow the backlight settings */
|
|
||||||
BUTTONLIGHT_CONTROL_FADE,
|
BUTTONLIGHT_CONTROL_FADE,
|
||||||
|
|
||||||
} buttonlight_control;
|
} buttonlight_control;
|
||||||
|
|
||||||
static unsigned short buttonlight_trigger_now;
|
static unsigned short buttonlight_trigger_now;
|
||||||
|
|
@ -134,8 +127,6 @@ void __buttonlight_mode(enum buttonlight_mode mode)
|
||||||
default:
|
default:
|
||||||
return; /* unknown mode */
|
return; /* unknown mode */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -186,6 +177,12 @@ static void led_control_service(void)
|
||||||
backlight_control = BACKLIGHT_CONTROL_ON;
|
backlight_control = BACKLIGHT_CONTROL_ON;
|
||||||
break;
|
break;
|
||||||
case BACKLIGHT_CONTROL_FADE:
|
case BACKLIGHT_CONTROL_FADE:
|
||||||
|
/* Was this mode set while the backlight is already on/off? */
|
||||||
|
if(backlight_target==sc606regAval)
|
||||||
|
{
|
||||||
|
backlight_control = BACKLIGHT_CONTROL_IDLE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
sc606_changed=true;
|
sc606_changed=true;
|
||||||
sc606regCONFval |= 0x03;
|
sc606regCONFval |= 0x03;
|
||||||
if(backlight_target>sc606regAval)
|
if(backlight_target>sc606regAval)
|
||||||
|
|
@ -222,6 +219,12 @@ static void led_control_service(void)
|
||||||
buttonlight_control=BUTTONLIGHT_CONTROL_IDLE;
|
buttonlight_control=BUTTONLIGHT_CONTROL_IDLE;
|
||||||
break;
|
break;
|
||||||
case BUTTONLIGHT_CONTROL_FADE:
|
case BUTTONLIGHT_CONTROL_FADE:
|
||||||
|
/* Was this mode set while the button light is already on/off? */
|
||||||
|
if(buttonlight_target==sc606regBval)
|
||||||
|
{
|
||||||
|
buttonlight_control=BUTTONLIGHT_CONTROL_IDLE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
sc606_changed=true;
|
sc606_changed=true;
|
||||||
sc606regCONFval |= 0x3C;
|
sc606regCONFval |= 0x3C;
|
||||||
if(buttonlight_target>sc606regBval)
|
if(buttonlight_target>sc606regBval)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue