From 3a37f46fc92fe7f9846a4077cc1a985c500d1174 Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Sun, 18 Feb 2007 10:07:27 +0000 Subject: Fix CONFIG_BACKLIGHT warnings. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12393 a1c6a512-1295-4272-9138-f99709370657 --- apps/gui/gwps-common.c | 2 +- apps/menus/display_menu.c | 6 +++--- apps/plugins/jpeg.c | 4 ++-- apps/plugins/mpegplayer/mpegplayer.c | 4 ++-- apps/recorder/peakmeter.c | 6 +++--- apps/settings.c | 4 ++-- apps/settings.h | 2 +- apps/settings_list.c | 12 ++++++------ apps/sound_menu.c | 4 ++-- firmware/backlight.c | 8 ++++---- firmware/drivers/button.c | 14 +++++++------- firmware/export/backlight.h | 4 ++-- firmware/export/button.h | 3 +-- firmware/export/config.h | 4 ++++ firmware/powermgmt.c | 2 +- uisimulator/sdl/button.c | 10 +++++----- uisimulator/sdl/lcd-bitmap.c | 8 ++++---- uisimulator/sdl/lcd-charcell.c | 2 +- 18 files changed, 51 insertions(+), 48 deletions(-) diff --git a/apps/gui/gwps-common.c b/apps/gui/gwps-common.c index 0768c32fe9..619159ddff 100644 --- a/apps/gui/gwps-common.c +++ b/apps/gui/gwps-common.c @@ -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 */ diff --git a/apps/menus/display_menu.c b/apps/menus/display_menu.c index 5dc14ce5b9..143b47e3c1 100644 --- a/apps/menus/display_menu.c +++ b/apps/menus/display_menu.c @@ -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 diff --git a/apps/plugins/jpeg.c b/apps/plugins/jpeg.c index 8b90c21d61..f96c954e54 100644 --- a/apps/plugins/jpeg.c +++ b/apps/plugins/jpeg.c @@ -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 diff --git a/apps/plugins/mpegplayer/mpegplayer.c b/apps/plugins/mpegplayer/mpegplayer.c index 25a5d1a600..36f54dc224 100644 --- a/apps/plugins/mpegplayer/mpegplayer.c +++ b/apps/plugins/mpegplayer/mpegplayer.c @@ -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 diff --git a/apps/recorder/peakmeter.c b/apps/recorder/peakmeter.c index 69c5e95893..0e729f6f34 100644 --- a/apps/recorder/peakmeter.c +++ b/apps/recorder/peakmeter.c @@ -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 && @@ -1033,7 +1033,7 @@ void peak_meter_draw(struct screen *display, struct meter_scales *scales, } #endif /* HAVE_REMOTE_LCD */ } -#endif /*CONFIG_BACKLIGHT */ +#endif /* CONFIG_BACKLIGHT */ if (trig_status != TRIG_OFF) { int start_trigx, stop_trigx, ycenter; diff --git a/apps/settings.c b/apps/settings.c index 8c51181ea0..2001c354d3 100644 --- a/apps/settings.c +++ b/apps/settings.c @@ -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); diff --git a/apps/settings.h b/apps/settings.h index 52a45c18ae..f306f4b0de 100644 --- a/apps/settings.h +++ b/apps/settings.h @@ -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? */ diff --git a/apps/settings_list.c b/apps/settings_list.c index 5914577600..9f24c63a84 100644 --- a/apps/settings_list.c +++ b/apps/settings_list.c @@ -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", diff --git a/apps/sound_menu.c b/apps/sound_menu.c index c75b527db7..74618b1348 100644 --- a/apps/sound_menu.c +++ b/apps/sound_menu.c @@ -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 }, diff --git a/firmware/backlight.c b/firmware/backlight.c index 99da3df0a8..a273b94a38 100644 --- a/firmware/backlight.c +++ b/firmware/backlight.c @@ -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) */ diff --git a/firmware/drivers/button.c b/firmware/drivers/button.c index 5a40bdfde0..a1fd58c447 100644 --- a/firmware/drivers/button.c +++ b/firmware/drivers/button.c @@ -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; diff --git a/firmware/export/backlight.h b/firmware/export/backlight.h index 1cd6c47f36..2873666dd8 100644 --- a/firmware/export/backlight.h +++ b/firmware/export/backlight.h @@ -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 */ diff --git a/firmware/export/button.h b/firmware/export/button.h index 102d542d27..ea3effcaba 100644 --- a/firmware/export/button.h +++ b/firmware/export/button.h @@ -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); diff --git a/firmware/export/config.h b/firmware/export/config.h index 8283b37fc8..1a3e0be325 100644 --- a/firmware/export/config.h +++ b/firmware/export/config.h @@ -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 diff --git a/firmware/powermgmt.c b/firmware/powermgmt.c index a31acbcf0b..1a1d576e67 100644 --- a/firmware/powermgmt.c +++ b/firmware/powermgmt.c @@ -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 diff --git a/uisimulator/sdl/button.c b/uisimulator/sdl/button.c index f5da828914..6f274dd56d 100644 --- a/uisimulator/sdl/button.c +++ b/uisimulator/sdl/button.c @@ -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()) diff --git a/uisimulator/sdl/lcd-bitmap.c b/uisimulator/sdl/lcd-bitmap.c index d6e9f90a7f..be908f20e5 100644 --- a/uisimulator/sdl/lcd-bitmap.c +++ b/uisimulator/sdl/lcd-bitmap.c @@ -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< 0) { sdl_set_gradient(lcd_surface, &lcd_color_max, &lcd_backlight_color_zero, (1< 0) { -- cgit v1.2.3