From 5f1ec307db83e4980ffc60b9052a53ff9da13dab Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Sun, 7 Oct 2007 15:02:02 +0000 Subject: [PATCH] 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 --- apps/menus/settings_menu.c | 4 +- apps/settings.c | 2 +- apps/settings.h | 2 +- apps/settings_list.c | 6 +-- firmware/backlight.c | 50 +++++++++---------- firmware/drivers/button.c | 2 +- firmware/export/backlight.h | 6 +-- .../s3c2440/gigabeat-fx/backlight-meg-fx.c | 6 +-- .../s3c2440/gigabeat-fx/backlight-target.h | 6 +-- .../arm/s3c2440/gigabeat-fx/button-meg-fx.c | 6 +-- .../arm/s3c2440/gigabeat-fx/power-meg-fx.c | 2 +- .../target/arm/sandisk/backlight-c200_e200.c | 4 +- .../target/arm/sandisk/backlight-target.h | 4 +- .../arm/sandisk/sansa-e200/button-e200.c | 2 +- 14 files changed, 51 insertions(+), 51 deletions(-) diff --git a/apps/menus/settings_menu.c b/apps/menus/settings_menu.c index 9a4079f1d0..8adcfe9b7a 100644 --- a/apps/menus/settings_menu.c +++ b/apps/menus/settings_menu.c @@ -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 diff --git a/apps/settings.c b/apps/settings.c index 26036c8948..6656b84552 100644 --- a/apps/settings.c +++ b/apps/settings.c @@ -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); diff --git a/apps/settings.h b/apps/settings.h index ee8fd48831..7399f62b1e 100644 --- a/apps/settings.h +++ b/apps/settings.h @@ -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; diff --git a/apps/settings_list.c b/apps/settings_list.c index 7981f279ff..a409d51df1 100644 --- a/apps/settings_list.c +++ b/apps/settings_list.c @@ -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, diff --git a/firmware/backlight.c b/firmware/backlight.c index a0d08f1e83..7cbdeb45e8 100644 --- a/firmware/backlight.c +++ b/firmware/backlight.c @@ -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 diff --git a/firmware/drivers/button.c b/firmware/drivers/button.c index 7ab78f6cb0..3daa08b2c3 100644 --- a/firmware/drivers/button.c +++ b/firmware/drivers/button.c @@ -259,7 +259,7 @@ static void button_tick(void) { backlight_on(); #ifdef HAVE_BUTTON_LIGHT - button_backlight_on(); + buttonlight_on(); #endif } diff --git a/firmware/export/backlight.h b/firmware/export/backlight.h index a0e46d2ffe..8df45990fd 100644 --- a/firmware/export/backlight.h +++ b/firmware/export/backlight.h @@ -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 */ diff --git a/firmware/target/arm/s3c2440/gigabeat-fx/backlight-meg-fx.c b/firmware/target/arm/s3c2440/gigabeat-fx/backlight-meg-fx.c index d2beaeee87..c132be5f69 100644 --- a/firmware/target/arm/s3c2440/gigabeat-fx/backlight-meg-fx.c +++ b/firmware/target/arm/s3c2440/gigabeat-fx/backlight-meg-fx.c @@ -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; diff --git a/firmware/target/arm/s3c2440/gigabeat-fx/backlight-target.h b/firmware/target/arm/s3c2440/gigabeat-fx/backlight-target.h index c51d8f20f0..0589557791 100644 --- a/firmware/target/arm/s3c2440/gigabeat-fx/backlight-target.h +++ b/firmware/target/arm/s3c2440/gigabeat-fx/backlight-target.h @@ -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 diff --git a/firmware/target/arm/s3c2440/gigabeat-fx/button-meg-fx.c b/firmware/target/arm/s3c2440/gigabeat-fx/button-meg-fx.c index 5655d92ef8..4a818d6bfc 100644 --- a/firmware/target/arm/s3c2440/gigabeat-fx/button-meg-fx.c +++ b/firmware/target/arm/s3c2440/gigabeat-fx/button-meg-fx.c @@ -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; diff --git a/firmware/target/arm/s3c2440/gigabeat-fx/power-meg-fx.c b/firmware/target/arm/s3c2440/gigabeat-fx/power-meg-fx.c index 7921e0ccd4..ac37908b05 100644 --- a/firmware/target/arm/s3c2440/gigabeat-fx/power-meg-fx.c +++ b/firmware/target/arm/s3c2440/gigabeat-fx/power-meg-fx.c @@ -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); diff --git a/firmware/target/arm/sandisk/backlight-c200_e200.c b/firmware/target/arm/sandisk/backlight-c200_e200.c index 0dd4a2122b..f7835e1bd9 100644 --- a/firmware/target/arm/sandisk/backlight-c200_e200.c +++ b/firmware/target/arm/sandisk/backlight-c200_e200.c @@ -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 diff --git a/firmware/target/arm/sandisk/backlight-target.h b/firmware/target/arm/sandisk/backlight-target.h index 1b1a6ad4e1..53a87fbbb3 100644 --- a/firmware/target/arm/sandisk/backlight-target.h +++ b/firmware/target/arm/sandisk/backlight-target.h @@ -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 diff --git a/firmware/target/arm/sandisk/sansa-e200/button-e200.c b/firmware/target/arm/sandisk/sansa-e200/button-e200.c index f6a01c863c..5988e165a7 100644 --- a/firmware/target/arm/sandisk/sansa-e200/button-e200.c +++ b/firmware/target/arm/sandisk/sansa-e200/button-e200.c @@ -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(); }