mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-14 02:27:39 -04:00
Fix CONFIG_BACKLIGHT warnings.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12393 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
da88e84f48
commit
3a37f46fc9
18 changed files with 51 additions and 48 deletions
|
@ -2100,7 +2100,7 @@ bool gui_wps_refresh(struct gui_wps *gwps, int ffwd_offset,
|
|||
data->peak_meter_enabled = enable_pm;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BACKLIGHT
|
||||
#if CONFIG_BACKLIGHT
|
||||
if (global_settings.caption_backlight && state->id3) {
|
||||
/* turn on backlight n seconds before track ends, and turn it off n
|
||||
seconds into the new track. n == backlight_timeout, or 5s */
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
#include "lcd-remote.h"
|
||||
|
||||
|
||||
#ifdef CONFIG_BACKLIGHT
|
||||
#if CONFIG_BACKLIGHT
|
||||
int filterfirstkeypress_callback(int action,const struct menu_item_ex *this_item)
|
||||
{
|
||||
(void)this_item;
|
||||
|
@ -77,7 +77,7 @@ int flipdisplay_callback(int action,const struct menu_item_ex *this_item)
|
|||
|
||||
/***********************************/
|
||||
/* LCD MENU */
|
||||
#ifdef CONFIG_BACKLIGHT
|
||||
#if CONFIG_BACKLIGHT
|
||||
MENUITEM_SETTING(backlight_timeout, &global_settings.backlight_timeout, NULL);
|
||||
#if CONFIG_CHARGING
|
||||
MENUITEM_SETTING(backlight_timeout_plugged,
|
||||
|
@ -172,7 +172,7 @@ MENUITEM_FUNCTION(reset_colors, ID2P(LANG_RESET_COLORS),
|
|||
/* now the actual menu */
|
||||
MAKE_MENU(lcd_settings,ID2P(LANG_LCD_MENU),
|
||||
NULL, bitmap_icons_6x8[Icon_Display_menu]
|
||||
#ifdef CONFIG_BACKLIGHT
|
||||
#if CONFIG_BACKLIGHT
|
||||
,&backlight_timeout
|
||||
# if CONFIG_CHARGING
|
||||
,&backlight_timeout_plugged
|
||||
|
|
|
@ -2915,7 +2915,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
|||
(actually it should also set the timeout when plugged in,
|
||||
but the function backlight_set_timeout_plugged is not
|
||||
available in plugins) */
|
||||
#ifdef CONFIG_BACKLIGHT
|
||||
#if CONFIG_BACKLIGHT
|
||||
if (rb->global_settings->backlight_timeout > 0)
|
||||
rb->backlight_set_timeout(1);
|
||||
#endif
|
||||
|
@ -2931,7 +2931,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
|||
rb->ata_spindown(rb->global_settings->disk_spindown);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BACKLIGHT
|
||||
#if CONFIG_BACKLIGHT
|
||||
/* reset backlight settings */
|
||||
rb->backlight_set_timeout(rb->global_settings->backlight_timeout);
|
||||
#endif
|
||||
|
|
|
@ -883,7 +883,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
|||
(actually it should also set the timeout when plugged in,
|
||||
but the function backlight_set_timeout_plugged is not
|
||||
available in plugins) */
|
||||
#ifdef CONFIG_BACKLIGHT
|
||||
#if CONFIG_BACKLIGHT
|
||||
if (rb->global_settings->backlight_timeout > 0)
|
||||
rb->backlight_set_timeout(1);
|
||||
#endif
|
||||
|
@ -954,7 +954,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
|||
|
||||
rb->lcd_setfont(FONT_UI);
|
||||
|
||||
#ifdef CONFIG_BACKLIGHT
|
||||
#if CONFIG_BACKLIGHT
|
||||
/* reset backlight settings */
|
||||
rb->backlight_set_timeout(rb->global_settings->backlight_timeout);
|
||||
#endif
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
#include "peakmeter.h"
|
||||
#include "audio.h"
|
||||
#include "screen_access.h"
|
||||
#ifdef CONFIG_BACKLIGHT
|
||||
#if CONFIG_BACKLIGHT
|
||||
#include "backlight.h"
|
||||
#endif
|
||||
#include "action.h"
|
||||
|
@ -1009,7 +1009,7 @@ void peak_meter_draw(struct screen *display, struct meter_scales *scales,
|
|||
|
||||
#ifdef HAVE_RECORDING
|
||||
|
||||
#ifdef CONFIG_BACKLIGHT
|
||||
#if CONFIG_BACKLIGHT
|
||||
/* cliplight */
|
||||
if ((pm_clip_left || pm_clip_right) &&
|
||||
global_settings.cliplight &&
|
||||
|
|
|
@ -706,7 +706,7 @@ void settings_apply(void)
|
|||
remote_backlight_set_on_button_hold(global_settings.remote_backlight_on_button_hold);
|
||||
#endif
|
||||
#endif /* HAVE_REMOTE_LCD */
|
||||
#ifdef CONFIG_BACKLIGHT
|
||||
#if CONFIG_BACKLIGHT
|
||||
backlight_set_timeout(global_settings.backlight_timeout);
|
||||
#if CONFIG_CHARGING
|
||||
backlight_set_timeout_plugged(global_settings.backlight_timeout_plugged);
|
||||
|
@ -848,7 +848,7 @@ void settings_apply(void)
|
|||
spdif_power_enable(global_settings.spdif_enable);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BACKLIGHT
|
||||
#if CONFIG_BACKLIGHT
|
||||
set_backlight_filter_keypress(global_settings.bl_filter_first_keypress);
|
||||
#ifdef HAVE_REMOTE_LCD
|
||||
set_remote_backlight_filter_keypress(global_settings.remote_bl_filter_first_keypress);
|
||||
|
|
|
@ -609,7 +609,7 @@ struct user_settings
|
|||
#endif
|
||||
bool party_mode; /* party mode - unstoppable music */
|
||||
|
||||
#ifdef CONFIG_BACKLIGHT
|
||||
#if CONFIG_BACKLIGHT
|
||||
bool bl_filter_first_keypress; /* filter first keypress when dark? */
|
||||
#ifdef HAVE_REMOTE_LCD
|
||||
bool remote_bl_filter_first_keypress; /* filter first remote keypress when remote dark? */
|
||||
|
|
|
@ -87,7 +87,7 @@ static const char trig_durations_conf [] =
|
|||
|
||||
#endif /* HAVE_RECORDING */
|
||||
|
||||
#if defined(CONFIG_BACKLIGHT)
|
||||
#if CONFIG_BACKLIGHT
|
||||
static const char backlight_times_conf [] =
|
||||
"off,on,1,2,3,4,5,6,7,8,9,10,15,20,25,30,45,60,90";
|
||||
static const int backlight_times[] =
|
||||
|
@ -410,7 +410,7 @@ const struct settings_list settings[] = {
|
|||
{ lcd_set_contrast, UNIT_INT, MIN_CONTRAST_SETTING,
|
||||
MAX_CONTRAST_SETTING, 1, NULL, NULL}}}},
|
||||
#endif
|
||||
#ifdef CONFIG_BACKLIGHT
|
||||
#if CONFIG_BACKLIGHT
|
||||
INT_SETTING_W_CFGVALS(0, backlight_timeout, LANG_BACKLIGHT, 6,
|
||||
"backlight timeout", backlight_times_conf, UNIT_SEC,
|
||||
0, 18, 1, backlight_formatter, backlight_getlang,
|
||||
|
@ -516,7 +516,7 @@ const struct settings_list settings[] = {
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BACKLIGHT
|
||||
#if CONFIG_BACKLIGHT
|
||||
OFFON_SETTING(0,bl_filter_first_keypress,
|
||||
LANG_BACKLIGHT_FILTER_FIRST_KEYPRESS, false,
|
||||
"backlight filters first keypress", NULL),
|
||||
|
@ -529,7 +529,7 @@ const struct settings_list settings[] = {
|
|||
|
||||
/** End of old RTC config block **/
|
||||
|
||||
#ifdef CONFIG_BACKLIGHT
|
||||
#if CONFIG_BACKLIGHT
|
||||
OFFON_SETTING(0,caption_backlight, LANG_CAPTION_BACKLIGHT,
|
||||
false,"caption backlight",NULL),
|
||||
#ifdef HAVE_REMOTE_LCD
|
||||
|
@ -748,7 +748,7 @@ const struct settings_list settings[] = {
|
|||
INT(0),"prerecording time",NULL,UNUSED},
|
||||
{F_T_INT,&global_settings.rec_directory,LANG_RECORD_DIRECTORY,
|
||||
INT(0),"rec directory",REC_BASE_DIR ",current",UNUSED},
|
||||
#ifdef CONFIG_BACKLIGHT
|
||||
#if CONFIG_BACKLIGHT
|
||||
{F_T_INT,&global_settings.cliplight,LANG_CLIP_LIGHT,INT(0),
|
||||
"cliplight","off,main,both,remote",UNUSED},
|
||||
#endif
|
||||
|
@ -926,7 +926,7 @@ const struct settings_list settings[] = {
|
|||
LANG_WARN_ERASEDYNPLAYLIST_MENU,false,
|
||||
"warn when erasing dynamic playlist",NULL),
|
||||
|
||||
#ifdef CONFIG_BACKLIGHT
|
||||
#if CONFIG_BACKLIGHT
|
||||
#ifdef HAS_BUTTON_HOLD
|
||||
CHOICE_SETTING(0, backlight_on_button_hold,
|
||||
LANG_BACKLIGHT_ON_BUTTON_HOLD, 0, "backlight on button hold",
|
||||
|
|
|
@ -430,7 +430,7 @@ static bool reconstartup(void)
|
|||
&global_settings.rec_startup);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_BACKLIGHT
|
||||
#if CONFIG_BACKLIGHT
|
||||
static bool cliplight(void)
|
||||
{
|
||||
static const struct opt_items names[] = {
|
||||
|
@ -941,7 +941,7 @@ bool recording_menu(bool no_source)
|
|||
{ ID2P(LANG_RECORD_PRERECORD_TIME), recprerecord },
|
||||
{ ID2P(LANG_RECORD_DIRECTORY), recdirectory },
|
||||
{ ID2P(LANG_RECORD_STARTUP), reconstartup },
|
||||
#ifdef CONFIG_BACKLIGHT
|
||||
#if CONFIG_BACKLIGHT
|
||||
{ ID2P(LANG_CLIP_LIGHT), cliplight },
|
||||
#endif
|
||||
{ ID2P(LANG_RECORD_TRIGGER), rectrigger },
|
||||
|
|
|
@ -90,7 +90,7 @@ static inline void __backlight_off(void)
|
|||
#endif
|
||||
#endif /* SIMULATOR */
|
||||
|
||||
#if defined(CONFIG_BACKLIGHT) && !defined(BOOTLOADER)
|
||||
#if CONFIG_BACKLIGHT && !defined(BOOTLOADER)
|
||||
|
||||
const signed char backlight_timeout_value[19] =
|
||||
{
|
||||
|
@ -804,10 +804,10 @@ void backlight_set_brightness(int val)
|
|||
}
|
||||
#endif /* HAVE_BACKLIGHT_BRIGHTNESS */
|
||||
|
||||
#else /* !defined(CONFIG_BACKLIGHT) || defined(BOOTLOADER)
|
||||
#else /* (CONFIG_BACKLIGHT == 0) || defined(BOOTLOADER)
|
||||
-- no backlight, empty dummy functions */
|
||||
|
||||
#if defined(BOOTLOADER) && defined(CONFIG_BACKLIGHT)
|
||||
#if defined(BOOTLOADER) && CONFIG_BACKLIGHT
|
||||
void backlight_init(void)
|
||||
{
|
||||
#ifdef __BACKLIGHT_INIT
|
||||
|
@ -830,4 +830,4 @@ bool is_remote_backlight_on(void) {return true;}
|
|||
#ifdef HAVE_BACKLIGHT_BRIGHTNESS
|
||||
void backlight_set_brightness(int val) { (void)val; }
|
||||
#endif
|
||||
#endif /* defined(CONFIG_BACKLIGHT) && !defined(BOOTLOADER) */
|
||||
#endif /* CONFIG_BACKLIGHT && !defined(BOOTLOADER) */
|
||||
|
|
|
@ -43,7 +43,7 @@ static long last_read; /* Last button status, for debouncing/filtering */
|
|||
#ifdef HAVE_LCD_BITMAP
|
||||
static bool flipped; /* buttons can be flipped to match the LCD flip */
|
||||
#endif
|
||||
#ifdef CONFIG_BACKLIGHT
|
||||
#if CONFIG_BACKLIGHT
|
||||
static bool filter_first_keypress;
|
||||
#ifdef HAVE_REMOTE_LCD
|
||||
static bool remote_filter_first_keypress;
|
||||
|
@ -71,7 +71,7 @@ static void button_tick(void)
|
|||
static int repeat_count = 0;
|
||||
static bool repeat = false;
|
||||
static bool post = false;
|
||||
#ifdef CONFIG_BACKLIGHT
|
||||
#if CONFIG_BACKLIGHT
|
||||
static bool skip_release = false;
|
||||
#ifdef HAVE_REMOTE_LCD
|
||||
static bool skip_remote_release = false;
|
||||
|
@ -112,7 +112,7 @@ static void button_tick(void)
|
|||
diff = btn ^ lastbtn;
|
||||
if(diff && (btn & diff) == 0)
|
||||
{
|
||||
#ifdef CONFIG_BACKLIGHT
|
||||
#if CONFIG_BACKLIGHT
|
||||
#ifdef HAVE_REMOTE_LCD
|
||||
if(diff & BUTTON_REMOTE)
|
||||
if(!skip_remote_release)
|
||||
|
@ -202,7 +202,7 @@ static void button_tick(void)
|
|||
if (queue_empty(&button_queue))
|
||||
{
|
||||
queue_post(&button_queue, BUTTON_REPEAT | btn, 0);
|
||||
#ifdef CONFIG_BACKLIGHT
|
||||
#if CONFIG_BACKLIGHT
|
||||
#ifdef HAVE_REMOTE_LCD
|
||||
skip_remote_release = false;
|
||||
#endif
|
||||
|
@ -213,7 +213,7 @@ static void button_tick(void)
|
|||
}
|
||||
else
|
||||
{
|
||||
#ifdef CONFIG_BACKLIGHT
|
||||
#if CONFIG_BACKLIGHT
|
||||
#ifdef HAVE_REMOTE_LCD
|
||||
if (btn & BUTTON_REMOTE) {
|
||||
if (!remote_filter_first_keypress || is_remote_backlight_on()
|
||||
|
@ -288,7 +288,7 @@ void button_init(void)
|
|||
#ifdef HAVE_LCD_BITMAP
|
||||
flipped = false;
|
||||
#endif
|
||||
#ifdef CONFIG_BACKLIGHT
|
||||
#if CONFIG_BACKLIGHT
|
||||
filter_first_keypress = false;
|
||||
#ifdef HAVE_REMOTE_LCD
|
||||
remote_filter_first_keypress = false;
|
||||
|
@ -360,7 +360,7 @@ void button_set_flip(bool flip)
|
|||
}
|
||||
#endif /* HAVE_LCD_BITMAP */
|
||||
|
||||
#ifdef CONFIG_BACKLIGHT
|
||||
#if CONFIG_BACKLIGHT
|
||||
void set_backlight_filter_keypress(bool value)
|
||||
{
|
||||
filter_first_keypress = value;
|
||||
|
|
|
@ -26,7 +26,7 @@ void backlight_on(void);
|
|||
void backlight_off(void);
|
||||
void backlight_set_timeout(int index);
|
||||
|
||||
#ifdef CONFIG_BACKLIGHT
|
||||
#if CONFIG_BACKLIGHT
|
||||
void backlight_init(void);
|
||||
|
||||
#if defined(IAUDIO_X5) && !defined(SIMULATOR)
|
||||
|
@ -54,7 +54,7 @@ void lcd_set_sleep_after_backlight_off(int index);
|
|||
extern const signed char lcd_sleep_timeout_value[];
|
||||
#endif
|
||||
|
||||
#else /* ndef CONFIG_BACKLIGHT */
|
||||
#else /* CONFIG_BACKLIGHT == 0 */
|
||||
#define backlight_init()
|
||||
#endif /* CONFIG_BACKLIGHT */
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
/***************************************************************************
|
||||
* __________ __ ___.
|
||||
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
||||
|
@ -34,7 +33,7 @@ void button_clear_queue(void);
|
|||
#ifdef HAVE_LCD_BITMAP
|
||||
void button_set_flip(bool flip); /* turn 180 degrees */
|
||||
#endif
|
||||
#ifdef CONFIG_BACKLIGHT
|
||||
#if CONFIG_BACKLIGHT
|
||||
void set_backlight_filter_keypress(bool value);
|
||||
#ifdef HAVE_REMOTE_LCD
|
||||
void set_remote_backlight_filter_keypress(bool value);
|
||||
|
|
|
@ -230,6 +230,10 @@
|
|||
#define CONFIG_LED 0
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_BACKLIGHT
|
||||
#define CONFIG_BACKLIGHT 0
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_CHARGING
|
||||
#define CONFIG_CHARGING 0
|
||||
#endif
|
||||
|
|
|
@ -702,7 +702,7 @@ static int runcurrent(void)
|
|||
current = CURRENT_USB;
|
||||
}
|
||||
|
||||
#if defined(CONFIG_BACKLIGHT) && !defined(BOOTLOADER)
|
||||
#if CONFIG_BACKLIGHT && !defined(BOOTLOADER)
|
||||
if (backlight_get_current_timeout() == 0) /* LED always on */
|
||||
current += CURRENT_BACKLIGHT;
|
||||
#endif
|
||||
|
|
|
@ -49,7 +49,7 @@ struct event_queue button_queue;
|
|||
|
||||
static int btn = 0; /* Hopefully keeps track of currently pressed keys... */
|
||||
|
||||
#ifdef CONFIG_BACKLIGHT
|
||||
#if CONFIG_BACKLIGHT
|
||||
static bool filter_first_keypress;
|
||||
|
||||
void set_backlight_filter_keypress(bool value)
|
||||
|
@ -76,7 +76,7 @@ void button_event(int key, bool pressed)
|
|||
static int repeat_count = 0;
|
||||
static bool repeat = false;
|
||||
static bool post = false;
|
||||
#ifdef CONFIG_BACKLIGHT
|
||||
#if CONFIG_BACKLIGHT
|
||||
static bool skip_release = false;
|
||||
#ifdef HAVE_REMOTE_LCD
|
||||
static bool skip_remote_release = false;
|
||||
|
@ -520,7 +520,7 @@ void button_event(int key, bool pressed)
|
|||
diff = btn ^ lastbtn;
|
||||
if(diff && (btn & diff) == 0)
|
||||
{
|
||||
#ifdef CONFIG_BACKLIGHT
|
||||
#if CONFIG_BACKLIGHT
|
||||
#ifdef HAVE_REMOTE_LCD
|
||||
if(diff & BUTTON_REMOTE)
|
||||
if(!skip_remote_release)
|
||||
|
@ -587,7 +587,7 @@ void button_event(int key, bool pressed)
|
|||
if (queue_empty(&button_queue))
|
||||
{
|
||||
queue_post(&button_queue, BUTTON_REPEAT | btn, 0);
|
||||
#ifdef CONFIG_BACKLIGHT
|
||||
#if CONFIG_BACKLIGHT
|
||||
#ifdef HAVE_REMOTE_LCD
|
||||
if(btn & BUTTON_REMOTE)
|
||||
{
|
||||
|
@ -604,7 +604,7 @@ void button_event(int key, bool pressed)
|
|||
}
|
||||
else
|
||||
{
|
||||
#ifdef CONFIG_BACKLIGHT
|
||||
#if CONFIG_BACKLIGHT
|
||||
#ifdef HAVE_REMOTE_LCD
|
||||
if (btn & BUTTON_REMOTE) {
|
||||
if (!remote_filter_first_keypress || is_remote_backlight_on())
|
||||
|
|
|
@ -25,7 +25,7 @@ SDL_Surface* lcd_surface;
|
|||
int lcd_backlight_val;
|
||||
|
||||
#if LCD_DEPTH <= 8
|
||||
#ifdef CONFIG_BACKLIGHT
|
||||
#if CONFIG_BACKLIGHT
|
||||
SDL_Color lcd_backlight_color_zero = {UI_LCD_BGCOLORLIGHT, 0};
|
||||
#endif
|
||||
SDL_Color lcd_color_zero = {UI_LCD_BGCOLOR, 0};
|
||||
|
@ -71,7 +71,7 @@ void lcd_update_rect(int x_start, int y_start, int width, int height)
|
|||
LCD_HEIGHT, background ? UI_LCD_POSX : 0, background? UI_LCD_POSY : 0);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_BACKLIGHT
|
||||
#if CONFIG_BACKLIGHT
|
||||
void sim_backlight(int value)
|
||||
{
|
||||
lcd_backlight_val = value;
|
||||
|
@ -118,7 +118,7 @@ void sim_lcd_init(void)
|
|||
#endif
|
||||
|
||||
#if LCD_DEPTH <= 8
|
||||
#ifdef CONFIG_BACKLIGHT
|
||||
#if CONFIG_BACKLIGHT
|
||||
sdl_set_gradient(lcd_surface, &lcd_backlight_color_zero, &lcd_color_max,
|
||||
0, (1<<LCD_DEPTH));
|
||||
#else
|
||||
|
@ -134,7 +134,7 @@ void sim_lcd_ex_init(int shades, unsigned long (*getpixel)(int, int))
|
|||
lcd_ex_shades = shades;
|
||||
lcd_ex_getpixel = getpixel;
|
||||
if (shades) {
|
||||
#ifdef CONFIG_BACKLIGHT
|
||||
#if CONFIG_BACKLIGHT
|
||||
if (lcd_backlight_val > 0) {
|
||||
sdl_set_gradient(lcd_surface, &lcd_color_max,
|
||||
&lcd_backlight_color_zero, (1<<LCD_DEPTH),
|
||||
|
|
|
@ -114,7 +114,7 @@ void drawrectangles(int color, struct rectangle *points, int count)
|
|||
SDL_UnlockSurface(lcd_surface);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_BACKLIGHT
|
||||
#if CONFIG_BACKLIGHT
|
||||
void sim_backlight(int value)
|
||||
{
|
||||
if (value > 0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue