Name all button light functions and variables consistently starting with buttonlight_ .
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15016 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
0464c36bdc
commit
5f1ec307db
14 changed files with 51 additions and 51 deletions
|
@ -337,7 +337,7 @@ MENUITEM_SETTING(car_adapter_mode, &global_settings.car_adapter_mode, NULL);
|
|||
MENUITEM_SETTING(start_screen, &global_settings.start_in_screen, NULL);
|
||||
|
||||
#ifdef HAVE_BUTTON_LIGHT
|
||||
MENUITEM_SETTING(button_light_timeout, &global_settings.button_light_timeout, NULL);
|
||||
MENUITEM_SETTING(buttonlight_timeout, &global_settings.buttonlight_timeout, NULL);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_BUTTONLIGHT_BRIGHTNESS
|
||||
|
@ -371,7 +371,7 @@ MAKE_MENU(system_menu, ID2P(LANG_SYSTEM),
|
|||
&car_adapter_mode,
|
||||
#endif
|
||||
#ifdef HAVE_BUTTON_LIGHT
|
||||
&button_light_timeout,
|
||||
&buttonlight_timeout,
|
||||
#endif
|
||||
#ifdef HAVE_BUTTONLIGHT_BRIGHTNESS
|
||||
&buttonlight_brightness
|
||||
|
|
|
@ -713,7 +713,7 @@ void settings_apply(void)
|
|||
buttonlight_set_brightness(global_settings.buttonlight_brightness);
|
||||
#endif
|
||||
#ifdef HAVE_BUTTON_LIGHT
|
||||
button_backlight_set_timeout(global_settings.button_light_timeout);
|
||||
buttonlight_set_timeout(global_settings.buttonlight_timeout);
|
||||
#endif
|
||||
#ifndef HAVE_FLASH_STORAGE
|
||||
ata_spindown(global_settings.disk_spindown);
|
||||
|
|
|
@ -739,7 +739,7 @@ struct user_settings
|
|||
unsigned char colors_file[MAX_FILENAME+1];
|
||||
#endif
|
||||
#ifdef HAVE_BUTTON_LIGHT
|
||||
int button_light_timeout;
|
||||
int buttonlight_timeout;
|
||||
#endif
|
||||
#ifdef HAVE_BUTTONLIGHT_BRIGHTNESS
|
||||
int buttonlight_brightness;
|
||||
|
|
|
@ -711,7 +711,7 @@ const struct settings_list settings[] = {
|
|||
TALK_ID(7, UNIT_SEC), TALK_ID(8, UNIT_SEC), TALK_ID(9, UNIT_SEC),
|
||||
TALK_ID(10, UNIT_SEC), TALK_ID(15, UNIT_SEC), TALK_ID(20, UNIT_SEC),
|
||||
TALK_ID(25, UNIT_SEC), TALK_ID(30, UNIT_SEC), TALK_ID(45, UNIT_SEC),
|
||||
TALK_ID(60, UNIT_SEC), TALK_ID(90, UNIT_SEC), TALK_ID(2, UNIT_MIN),
|
||||
TALK_ID(60, UNIT_SEC), TALK_ID(90, UNIT_SEC), TALK_ID(2, UNIT_MIN),
|
||||
TALK_ID(3, UNIT_MIN), TALK_ID(5, UNIT_MIN), TALK_ID(10, UNIT_MIN),
|
||||
TALK_ID(20, UNIT_MIN), TALK_ID(45, UNIT_MIN), TALK_ID(90, UNIT_MIN)),
|
||||
STRINGCHOICE_SETTING(0, peak_meter_hold, LANG_PM_PEAK_HOLD, 3,
|
||||
|
@ -1254,11 +1254,11 @@ const struct settings_list settings[] = {
|
|||
THEME_DIR "/", ".colours", MAX_FILENAME+1),
|
||||
#endif
|
||||
#ifdef HAVE_BUTTON_LIGHT
|
||||
INT_SETTING_W_CFGVALS(F_FLIPLIST, button_light_timeout,
|
||||
INT_SETTING_W_CFGVALS(F_FLIPLIST, buttonlight_timeout,
|
||||
LANG_BUTTONLIGHT_TIMEOUT, 6,
|
||||
"button light timeout", backlight_times_conf, UNIT_SEC,
|
||||
0, 18, 1, backlight_formatter, backlight_getlang,
|
||||
button_backlight_set_timeout),
|
||||
buttonlight_set_timeout),
|
||||
#endif
|
||||
#ifdef HAVE_BUTTONLIGHT_BRIGHTNESS
|
||||
INT_SETTING(0, buttonlight_brightness, LANG_BUTTONLIGHT_BRIGHTNESS, DEFAULT_BRIGHTNESS_SETTING,
|
||||
|
|
|
@ -108,66 +108,66 @@ static int backlight_on_button_hold = 0;
|
|||
#endif
|
||||
|
||||
#ifdef HAVE_BUTTON_LIGHT
|
||||
static int button_backlight_timer;
|
||||
static int button_backlight_timeout = 5*HZ;
|
||||
static int buttonlight_timer;
|
||||
static int buttonlight_timeout = 5*HZ;
|
||||
|
||||
/* internal interface */
|
||||
static void _button_backlight_on(void)
|
||||
static void _buttonlight_on(void)
|
||||
{
|
||||
#ifndef SIMULATOR
|
||||
#ifdef HAVE_BUTTONLIGHT_BRIGHTNESS
|
||||
__button_backlight_dim(false);
|
||||
__buttonlight_dim(false);
|
||||
#else
|
||||
__button_backlight_on();
|
||||
__buttonlight_on();
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
void _button_backlight_off(void)
|
||||
void _buttonlight_off(void)
|
||||
{
|
||||
#ifndef SIMULATOR
|
||||
#ifdef HAVE_BUTTONLIGHT_BRIGHTNESS
|
||||
if(button_backlight_timeout>0)
|
||||
__button_backlight_dim(true);
|
||||
if(buttonlight_timeout>0)
|
||||
__buttonlight_dim(true);
|
||||
else
|
||||
#endif
|
||||
__button_backlight_off();
|
||||
__buttonlight_off();
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Update state of buttonlight according to timeout setting */
|
||||
static void buttonlight_update_state(void)
|
||||
{
|
||||
button_backlight_timer = button_backlight_timeout;
|
||||
buttonlight_timer = buttonlight_timeout;
|
||||
|
||||
/* Buttonlight == OFF in the setting? */
|
||||
if (button_backlight_timer < 0)
|
||||
if (buttonlight_timer < 0)
|
||||
{
|
||||
button_backlight_timer = 0; /* Disable the timeout */
|
||||
_button_backlight_off();
|
||||
buttonlight_timer = 0; /* Disable the timeout */
|
||||
_buttonlight_off();
|
||||
}
|
||||
else
|
||||
_button_backlight_on();
|
||||
_buttonlight_on();
|
||||
}
|
||||
|
||||
/* external interface */
|
||||
void button_backlight_on(void)
|
||||
void buttonlight_on(void)
|
||||
{
|
||||
queue_remove_from_head(&backlight_queue, BUTTON_LIGHT_ON);
|
||||
queue_post(&backlight_queue, BUTTON_LIGHT_ON, 0);
|
||||
}
|
||||
|
||||
void button_backlight_off(void)
|
||||
void buttonlight_off(void)
|
||||
{
|
||||
queue_post(&backlight_queue, BUTTON_LIGHT_OFF, 0);
|
||||
}
|
||||
|
||||
void button_backlight_set_timeout(int index)
|
||||
void buttonlight_set_timeout(int index)
|
||||
{
|
||||
if((unsigned)index >= sizeof(backlight_timeout_value))
|
||||
/* if given a weird value, use default */
|
||||
index = 6;
|
||||
button_backlight_timeout = HZ * backlight_timeout_value[index];
|
||||
buttonlight_timeout = HZ * backlight_timeout_value[index];
|
||||
buttonlight_update_state();
|
||||
}
|
||||
|
||||
|
@ -543,8 +543,8 @@ void backlight_thread(void)
|
|||
break;
|
||||
|
||||
case BUTTON_LIGHT_OFF:
|
||||
button_backlight_timer = 0;
|
||||
_button_backlight_off();
|
||||
buttonlight_timer = 0;
|
||||
_buttonlight_off();
|
||||
break;
|
||||
#endif
|
||||
|
||||
|
@ -597,12 +597,12 @@ static void backlight_tick(void)
|
|||
}
|
||||
#endif /* HAVE_REMOVE_LCD */
|
||||
#ifdef HAVE_BUTTON_LIGHT
|
||||
if (button_backlight_timer)
|
||||
if (buttonlight_timer)
|
||||
{
|
||||
button_backlight_timer--;
|
||||
if (button_backlight_timer == 0)
|
||||
buttonlight_timer--;
|
||||
if (buttonlight_timer == 0)
|
||||
{
|
||||
button_backlight_off();
|
||||
buttonlight_off();
|
||||
}
|
||||
}
|
||||
#endif /* HAVE_BUTTON_LIGHT */
|
||||
|
@ -825,7 +825,7 @@ void backlight_init(void)
|
|||
|
||||
void backlight_on(void) {}
|
||||
void backlight_off(void) {}
|
||||
void button_backlight_on(void) {}
|
||||
void buttonlight_on(void) {}
|
||||
void backlight_set_timeout(int index) {(void)index;}
|
||||
bool is_backlight_on(void) {return true;}
|
||||
#ifdef HAVE_REMOTE_LCD
|
||||
|
|
|
@ -259,7 +259,7 @@ static void button_tick(void)
|
|||
{
|
||||
backlight_on();
|
||||
#ifdef HAVE_BUTTON_LIGHT
|
||||
button_backlight_on();
|
||||
buttonlight_on();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -80,9 +80,9 @@ void buttonlight_set_brightness(int val);
|
|||
#endif /* HAVE_BUTTONLIGHT_BRIGHTNESS */
|
||||
|
||||
#ifdef HAVE_BUTTON_LIGHT
|
||||
void button_backlight_on(void);
|
||||
void button_backlight_off(void);
|
||||
void button_backlight_set_timeout(int index);
|
||||
void buttonlight_on(void);
|
||||
void buttonlight_off(void);
|
||||
void buttonlight_set_timeout(int index);
|
||||
#endif
|
||||
|
||||
#endif /* BACKLIGHT_H */
|
||||
|
|
|
@ -328,17 +328,17 @@ static void led_control_service(void)
|
|||
}
|
||||
#endif /* BOOTLOADER */
|
||||
|
||||
void __button_backlight_on(void)
|
||||
void __buttonlight_on(void)
|
||||
{
|
||||
buttonlight_control = BUTTONLIGHT_CONTROL_ON;
|
||||
}
|
||||
|
||||
void __button_backlight_off(void)
|
||||
void __buttonlight_off(void)
|
||||
{
|
||||
buttonlight_control = BUTTONLIGHT_CONTROL_OFF;
|
||||
}
|
||||
|
||||
void __button_backlight_dim(bool dim_now)
|
||||
void __buttonlight_dim(bool dim_now)
|
||||
{
|
||||
buttonlight_control = BUTTONLIGHT_CONTROL_IDLE;
|
||||
buttonlight_target = (dim_now == true) ? 0 : buttonlight_brightness;
|
||||
|
|
|
@ -48,11 +48,11 @@ void __backlight_set_brightness(int brightness);
|
|||
|
||||
void __buttonlight_set_brightness(int brightness);
|
||||
|
||||
void __button_backlight_on(void);
|
||||
void __button_backlight_off(void);
|
||||
void __buttonlight_on(void);
|
||||
void __buttonlight_off(void);
|
||||
|
||||
/* true: backlight fades off - false: backlight fades on */
|
||||
void __backlight_dim(bool dim);
|
||||
void __button_backlight_dim(bool dim_now);
|
||||
void __buttonlight_dim(bool dim_now);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -82,7 +82,7 @@ int button_read_device(void)
|
|||
/* if the buttons dont agree twice in a row, then its none */
|
||||
lastbutton = btn;
|
||||
btn = BUTTON_NONE;
|
||||
button_backlight_on();
|
||||
buttonlight_on();
|
||||
}
|
||||
|
||||
/* Check for hold first - exit if asserted with no button pressed */
|
||||
|
@ -107,7 +107,7 @@ int button_read_device(void)
|
|||
|
||||
if (buttons & (1 << 4))
|
||||
btn |= BUTTON_A;
|
||||
button_backlight_on();
|
||||
buttonlight_on();
|
||||
}
|
||||
|
||||
/* the touchpad */
|
||||
|
@ -128,7 +128,7 @@ int button_read_device(void)
|
|||
|
||||
if (touchpad & (1 << 3))
|
||||
btn |= BUTTON_SELECT;
|
||||
button_backlight_on();
|
||||
buttonlight_on();
|
||||
}
|
||||
|
||||
return btn;
|
||||
|
|
|
@ -64,7 +64,7 @@ void power_off(void)
|
|||
{
|
||||
/* turn off backlight and wait for 1 second */
|
||||
__backlight_off();
|
||||
__button_backlight_off();
|
||||
__buttonlight_off();
|
||||
sleep(HZ);
|
||||
/* set SLEEP bit to on in CLKCON to turn off */
|
||||
CLKCON |=(1<<3);
|
||||
|
|
|
@ -51,7 +51,7 @@ void __backlight_off(void)
|
|||
}
|
||||
|
||||
#ifdef HAVE_BUTTON_LIGHT
|
||||
void __button_backlight_on(void)
|
||||
void __buttonlight_on(void)
|
||||
{
|
||||
GPIOG_OUTPUT_VAL |= 0x80;
|
||||
#ifdef SANSA_C200
|
||||
|
@ -59,7 +59,7 @@ void __button_backlight_on(void)
|
|||
#endif
|
||||
}
|
||||
|
||||
void __button_backlight_off(void)
|
||||
void __buttonlight_off(void)
|
||||
{
|
||||
GPIOG_OUTPUT_VAL &=~ 0x80;
|
||||
#ifdef SANSA_C200
|
||||
|
|
|
@ -26,7 +26,7 @@ void __backlight_set_brightness(int brightness);
|
|||
int __backlight_is_on(void);
|
||||
|
||||
#ifdef HAVE_BUTTON_LIGHT
|
||||
void __button_backlight_on(void);
|
||||
void __button_backlight_off(void);
|
||||
void __buttonlight_on(void);
|
||||
void __buttonlight_off(void);
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -196,7 +196,7 @@ void clickwheel_int(void)
|
|||
than every 1/4 second*/
|
||||
next_backlight_on = current_tick + HZ/4;
|
||||
backlight_on();
|
||||
button_backlight_on();
|
||||
buttonlight_on();
|
||||
reset_poweroff_timer();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue