diff options
author | Jens Arnold <amiconn@rockbox.org> | 2007-02-18 10:07:27 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2007-02-18 10:07:27 +0000 |
commit | 3a37f46fc92fe7f9846a4077cc1a985c500d1174 (patch) | |
tree | 76541ae462f02ede816ab3f9b42f5207f068658c | |
parent | da88e84f482c8c96c0d64bf67969b6e9dd9a8379 (diff) | |
download | rockbox-3a37f46fc92fe7f9846a4077cc1a985c500d1174.tar.gz rockbox-3a37f46fc92fe7f9846a4077cc1a985c500d1174.zip |
Fix CONFIG_BACKLIGHT warnings.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12393 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/gui/gwps-common.c | 2 | ||||
-rw-r--r-- | apps/menus/display_menu.c | 6 | ||||
-rw-r--r-- | apps/plugins/jpeg.c | 4 | ||||
-rw-r--r-- | apps/plugins/mpegplayer/mpegplayer.c | 4 | ||||
-rw-r--r-- | apps/recorder/peakmeter.c | 6 | ||||
-rw-r--r-- | apps/settings.c | 4 | ||||
-rw-r--r-- | apps/settings.h | 2 | ||||
-rw-r--r-- | apps/settings_list.c | 12 | ||||
-rw-r--r-- | apps/sound_menu.c | 4 | ||||
-rw-r--r-- | firmware/backlight.c | 8 | ||||
-rw-r--r-- | firmware/drivers/button.c | 14 | ||||
-rw-r--r-- | firmware/export/backlight.h | 4 | ||||
-rw-r--r-- | firmware/export/button.h | 3 | ||||
-rw-r--r-- | firmware/export/config.h | 4 | ||||
-rw-r--r-- | firmware/powermgmt.c | 2 | ||||
-rw-r--r-- | uisimulator/sdl/button.c | 10 | ||||
-rw-r--r-- | uisimulator/sdl/lcd-bitmap.c | 8 | ||||
-rw-r--r-- | 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, | |||
2100 | data->peak_meter_enabled = enable_pm; | 2100 | data->peak_meter_enabled = enable_pm; |
2101 | #endif | 2101 | #endif |
2102 | 2102 | ||
2103 | #ifdef CONFIG_BACKLIGHT | 2103 | #if CONFIG_BACKLIGHT |
2104 | if (global_settings.caption_backlight && state->id3) { | 2104 | if (global_settings.caption_backlight && state->id3) { |
2105 | /* turn on backlight n seconds before track ends, and turn it off n | 2105 | /* turn on backlight n seconds before track ends, and turn it off n |
2106 | seconds into the new track. n == backlight_timeout, or 5s */ | 2106 | 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 @@ | |||
38 | #include "lcd-remote.h" | 38 | #include "lcd-remote.h" |
39 | 39 | ||
40 | 40 | ||
41 | #ifdef CONFIG_BACKLIGHT | 41 | #if CONFIG_BACKLIGHT |
42 | int filterfirstkeypress_callback(int action,const struct menu_item_ex *this_item) | 42 | int filterfirstkeypress_callback(int action,const struct menu_item_ex *this_item) |
43 | { | 43 | { |
44 | (void)this_item; | 44 | (void)this_item; |
@@ -77,7 +77,7 @@ int flipdisplay_callback(int action,const struct menu_item_ex *this_item) | |||
77 | 77 | ||
78 | /***********************************/ | 78 | /***********************************/ |
79 | /* LCD MENU */ | 79 | /* LCD MENU */ |
80 | #ifdef CONFIG_BACKLIGHT | 80 | #if CONFIG_BACKLIGHT |
81 | MENUITEM_SETTING(backlight_timeout, &global_settings.backlight_timeout, NULL); | 81 | MENUITEM_SETTING(backlight_timeout, &global_settings.backlight_timeout, NULL); |
82 | #if CONFIG_CHARGING | 82 | #if CONFIG_CHARGING |
83 | MENUITEM_SETTING(backlight_timeout_plugged, | 83 | MENUITEM_SETTING(backlight_timeout_plugged, |
@@ -172,7 +172,7 @@ MENUITEM_FUNCTION(reset_colors, ID2P(LANG_RESET_COLORS), | |||
172 | /* now the actual menu */ | 172 | /* now the actual menu */ |
173 | MAKE_MENU(lcd_settings,ID2P(LANG_LCD_MENU), | 173 | MAKE_MENU(lcd_settings,ID2P(LANG_LCD_MENU), |
174 | NULL, bitmap_icons_6x8[Icon_Display_menu] | 174 | NULL, bitmap_icons_6x8[Icon_Display_menu] |
175 | #ifdef CONFIG_BACKLIGHT | 175 | #if CONFIG_BACKLIGHT |
176 | ,&backlight_timeout | 176 | ,&backlight_timeout |
177 | # if CONFIG_CHARGING | 177 | # if CONFIG_CHARGING |
178 | ,&backlight_timeout_plugged | 178 | ,&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) | |||
2915 | (actually it should also set the timeout when plugged in, | 2915 | (actually it should also set the timeout when plugged in, |
2916 | but the function backlight_set_timeout_plugged is not | 2916 | but the function backlight_set_timeout_plugged is not |
2917 | available in plugins) */ | 2917 | available in plugins) */ |
2918 | #ifdef CONFIG_BACKLIGHT | 2918 | #if CONFIG_BACKLIGHT |
2919 | if (rb->global_settings->backlight_timeout > 0) | 2919 | if (rb->global_settings->backlight_timeout > 0) |
2920 | rb->backlight_set_timeout(1); | 2920 | rb->backlight_set_timeout(1); |
2921 | #endif | 2921 | #endif |
@@ -2931,7 +2931,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) | |||
2931 | rb->ata_spindown(rb->global_settings->disk_spindown); | 2931 | rb->ata_spindown(rb->global_settings->disk_spindown); |
2932 | #endif | 2932 | #endif |
2933 | 2933 | ||
2934 | #ifdef CONFIG_BACKLIGHT | 2934 | #if CONFIG_BACKLIGHT |
2935 | /* reset backlight settings */ | 2935 | /* reset backlight settings */ |
2936 | rb->backlight_set_timeout(rb->global_settings->backlight_timeout); | 2936 | rb->backlight_set_timeout(rb->global_settings->backlight_timeout); |
2937 | #endif | 2937 | #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) | |||
883 | (actually it should also set the timeout when plugged in, | 883 | (actually it should also set the timeout when plugged in, |
884 | but the function backlight_set_timeout_plugged is not | 884 | but the function backlight_set_timeout_plugged is not |
885 | available in plugins) */ | 885 | available in plugins) */ |
886 | #ifdef CONFIG_BACKLIGHT | 886 | #if CONFIG_BACKLIGHT |
887 | if (rb->global_settings->backlight_timeout > 0) | 887 | if (rb->global_settings->backlight_timeout > 0) |
888 | rb->backlight_set_timeout(1); | 888 | rb->backlight_set_timeout(1); |
889 | #endif | 889 | #endif |
@@ -954,7 +954,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) | |||
954 | 954 | ||
955 | rb->lcd_setfont(FONT_UI); | 955 | rb->lcd_setfont(FONT_UI); |
956 | 956 | ||
957 | #ifdef CONFIG_BACKLIGHT | 957 | #if CONFIG_BACKLIGHT |
958 | /* reset backlight settings */ | 958 | /* reset backlight settings */ |
959 | rb->backlight_set_timeout(rb->global_settings->backlight_timeout); | 959 | rb->backlight_set_timeout(rb->global_settings->backlight_timeout); |
960 | #endif | 960 | #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 @@ | |||
34 | #include "peakmeter.h" | 34 | #include "peakmeter.h" |
35 | #include "audio.h" | 35 | #include "audio.h" |
36 | #include "screen_access.h" | 36 | #include "screen_access.h" |
37 | #ifdef CONFIG_BACKLIGHT | 37 | #if CONFIG_BACKLIGHT |
38 | #include "backlight.h" | 38 | #include "backlight.h" |
39 | #endif | 39 | #endif |
40 | #include "action.h" | 40 | #include "action.h" |
@@ -1009,7 +1009,7 @@ void peak_meter_draw(struct screen *display, struct meter_scales *scales, | |||
1009 | 1009 | ||
1010 | #ifdef HAVE_RECORDING | 1010 | #ifdef HAVE_RECORDING |
1011 | 1011 | ||
1012 | #ifdef CONFIG_BACKLIGHT | 1012 | #if CONFIG_BACKLIGHT |
1013 | /* cliplight */ | 1013 | /* cliplight */ |
1014 | if ((pm_clip_left || pm_clip_right) && | 1014 | if ((pm_clip_left || pm_clip_right) && |
1015 | global_settings.cliplight && | 1015 | global_settings.cliplight && |
@@ -1033,7 +1033,7 @@ void peak_meter_draw(struct screen *display, struct meter_scales *scales, | |||
1033 | } | 1033 | } |
1034 | #endif /* HAVE_REMOTE_LCD */ | 1034 | #endif /* HAVE_REMOTE_LCD */ |
1035 | } | 1035 | } |
1036 | #endif /*CONFIG_BACKLIGHT */ | 1036 | #endif /* CONFIG_BACKLIGHT */ |
1037 | 1037 | ||
1038 | if (trig_status != TRIG_OFF) { | 1038 | if (trig_status != TRIG_OFF) { |
1039 | int start_trigx, stop_trigx, ycenter; | 1039 | 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) | |||
706 | remote_backlight_set_on_button_hold(global_settings.remote_backlight_on_button_hold); | 706 | remote_backlight_set_on_button_hold(global_settings.remote_backlight_on_button_hold); |
707 | #endif | 707 | #endif |
708 | #endif /* HAVE_REMOTE_LCD */ | 708 | #endif /* HAVE_REMOTE_LCD */ |
709 | #ifdef CONFIG_BACKLIGHT | 709 | #if CONFIG_BACKLIGHT |
710 | backlight_set_timeout(global_settings.backlight_timeout); | 710 | backlight_set_timeout(global_settings.backlight_timeout); |
711 | #if CONFIG_CHARGING | 711 | #if CONFIG_CHARGING |
712 | backlight_set_timeout_plugged(global_settings.backlight_timeout_plugged); | 712 | backlight_set_timeout_plugged(global_settings.backlight_timeout_plugged); |
@@ -848,7 +848,7 @@ void settings_apply(void) | |||
848 | spdif_power_enable(global_settings.spdif_enable); | 848 | spdif_power_enable(global_settings.spdif_enable); |
849 | #endif | 849 | #endif |
850 | 850 | ||
851 | #ifdef CONFIG_BACKLIGHT | 851 | #if CONFIG_BACKLIGHT |
852 | set_backlight_filter_keypress(global_settings.bl_filter_first_keypress); | 852 | set_backlight_filter_keypress(global_settings.bl_filter_first_keypress); |
853 | #ifdef HAVE_REMOTE_LCD | 853 | #ifdef HAVE_REMOTE_LCD |
854 | set_remote_backlight_filter_keypress(global_settings.remote_bl_filter_first_keypress); | 854 | 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 | |||
609 | #endif | 609 | #endif |
610 | bool party_mode; /* party mode - unstoppable music */ | 610 | bool party_mode; /* party mode - unstoppable music */ |
611 | 611 | ||
612 | #ifdef CONFIG_BACKLIGHT | 612 | #if CONFIG_BACKLIGHT |
613 | bool bl_filter_first_keypress; /* filter first keypress when dark? */ | 613 | bool bl_filter_first_keypress; /* filter first keypress when dark? */ |
614 | #ifdef HAVE_REMOTE_LCD | 614 | #ifdef HAVE_REMOTE_LCD |
615 | bool remote_bl_filter_first_keypress; /* filter first remote keypress when remote dark? */ | 615 | 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 [] = | |||
87 | 87 | ||
88 | #endif /* HAVE_RECORDING */ | 88 | #endif /* HAVE_RECORDING */ |
89 | 89 | ||
90 | #if defined(CONFIG_BACKLIGHT) | 90 | #if CONFIG_BACKLIGHT |
91 | static const char backlight_times_conf [] = | 91 | static const char backlight_times_conf [] = |
92 | "off,on,1,2,3,4,5,6,7,8,9,10,15,20,25,30,45,60,90"; | 92 | "off,on,1,2,3,4,5,6,7,8,9,10,15,20,25,30,45,60,90"; |
93 | static const int backlight_times[] = | 93 | static const int backlight_times[] = |
@@ -410,7 +410,7 @@ const struct settings_list settings[] = { | |||
410 | { lcd_set_contrast, UNIT_INT, MIN_CONTRAST_SETTING, | 410 | { lcd_set_contrast, UNIT_INT, MIN_CONTRAST_SETTING, |
411 | MAX_CONTRAST_SETTING, 1, NULL, NULL}}}}, | 411 | MAX_CONTRAST_SETTING, 1, NULL, NULL}}}}, |
412 | #endif | 412 | #endif |
413 | #ifdef CONFIG_BACKLIGHT | 413 | #if CONFIG_BACKLIGHT |
414 | INT_SETTING_W_CFGVALS(0, backlight_timeout, LANG_BACKLIGHT, 6, | 414 | INT_SETTING_W_CFGVALS(0, backlight_timeout, LANG_BACKLIGHT, 6, |
415 | "backlight timeout", backlight_times_conf, UNIT_SEC, | 415 | "backlight timeout", backlight_times_conf, UNIT_SEC, |
416 | 0, 18, 1, backlight_formatter, backlight_getlang, | 416 | 0, 18, 1, backlight_formatter, backlight_getlang, |
@@ -516,7 +516,7 @@ const struct settings_list settings[] = { | |||
516 | #endif | 516 | #endif |
517 | #endif | 517 | #endif |
518 | 518 | ||
519 | #ifdef CONFIG_BACKLIGHT | 519 | #if CONFIG_BACKLIGHT |
520 | OFFON_SETTING(0,bl_filter_first_keypress, | 520 | OFFON_SETTING(0,bl_filter_first_keypress, |
521 | LANG_BACKLIGHT_FILTER_FIRST_KEYPRESS, false, | 521 | LANG_BACKLIGHT_FILTER_FIRST_KEYPRESS, false, |
522 | "backlight filters first keypress", NULL), | 522 | "backlight filters first keypress", NULL), |
@@ -529,7 +529,7 @@ const struct settings_list settings[] = { | |||
529 | 529 | ||
530 | /** End of old RTC config block **/ | 530 | /** End of old RTC config block **/ |
531 | 531 | ||
532 | #ifdef CONFIG_BACKLIGHT | 532 | #if CONFIG_BACKLIGHT |
533 | OFFON_SETTING(0,caption_backlight, LANG_CAPTION_BACKLIGHT, | 533 | OFFON_SETTING(0,caption_backlight, LANG_CAPTION_BACKLIGHT, |
534 | false,"caption backlight",NULL), | 534 | false,"caption backlight",NULL), |
535 | #ifdef HAVE_REMOTE_LCD | 535 | #ifdef HAVE_REMOTE_LCD |
@@ -748,7 +748,7 @@ const struct settings_list settings[] = { | |||
748 | INT(0),"prerecording time",NULL,UNUSED}, | 748 | INT(0),"prerecording time",NULL,UNUSED}, |
749 | {F_T_INT,&global_settings.rec_directory,LANG_RECORD_DIRECTORY, | 749 | {F_T_INT,&global_settings.rec_directory,LANG_RECORD_DIRECTORY, |
750 | INT(0),"rec directory",REC_BASE_DIR ",current",UNUSED}, | 750 | INT(0),"rec directory",REC_BASE_DIR ",current",UNUSED}, |
751 | #ifdef CONFIG_BACKLIGHT | 751 | #if CONFIG_BACKLIGHT |
752 | {F_T_INT,&global_settings.cliplight,LANG_CLIP_LIGHT,INT(0), | 752 | {F_T_INT,&global_settings.cliplight,LANG_CLIP_LIGHT,INT(0), |
753 | "cliplight","off,main,both,remote",UNUSED}, | 753 | "cliplight","off,main,both,remote",UNUSED}, |
754 | #endif | 754 | #endif |
@@ -926,7 +926,7 @@ const struct settings_list settings[] = { | |||
926 | LANG_WARN_ERASEDYNPLAYLIST_MENU,false, | 926 | LANG_WARN_ERASEDYNPLAYLIST_MENU,false, |
927 | "warn when erasing dynamic playlist",NULL), | 927 | "warn when erasing dynamic playlist",NULL), |
928 | 928 | ||
929 | #ifdef CONFIG_BACKLIGHT | 929 | #if CONFIG_BACKLIGHT |
930 | #ifdef HAS_BUTTON_HOLD | 930 | #ifdef HAS_BUTTON_HOLD |
931 | CHOICE_SETTING(0, backlight_on_button_hold, | 931 | CHOICE_SETTING(0, backlight_on_button_hold, |
932 | LANG_BACKLIGHT_ON_BUTTON_HOLD, 0, "backlight on button hold", | 932 | 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) | |||
430 | &global_settings.rec_startup); | 430 | &global_settings.rec_startup); |
431 | } | 431 | } |
432 | 432 | ||
433 | #ifdef CONFIG_BACKLIGHT | 433 | #if CONFIG_BACKLIGHT |
434 | static bool cliplight(void) | 434 | static bool cliplight(void) |
435 | { | 435 | { |
436 | static const struct opt_items names[] = { | 436 | static const struct opt_items names[] = { |
@@ -941,7 +941,7 @@ bool recording_menu(bool no_source) | |||
941 | { ID2P(LANG_RECORD_PRERECORD_TIME), recprerecord }, | 941 | { ID2P(LANG_RECORD_PRERECORD_TIME), recprerecord }, |
942 | { ID2P(LANG_RECORD_DIRECTORY), recdirectory }, | 942 | { ID2P(LANG_RECORD_DIRECTORY), recdirectory }, |
943 | { ID2P(LANG_RECORD_STARTUP), reconstartup }, | 943 | { ID2P(LANG_RECORD_STARTUP), reconstartup }, |
944 | #ifdef CONFIG_BACKLIGHT | 944 | #if CONFIG_BACKLIGHT |
945 | { ID2P(LANG_CLIP_LIGHT), cliplight }, | 945 | { ID2P(LANG_CLIP_LIGHT), cliplight }, |
946 | #endif | 946 | #endif |
947 | { ID2P(LANG_RECORD_TRIGGER), rectrigger }, | 947 | { 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) | |||
90 | #endif | 90 | #endif |
91 | #endif /* SIMULATOR */ | 91 | #endif /* SIMULATOR */ |
92 | 92 | ||
93 | #if defined(CONFIG_BACKLIGHT) && !defined(BOOTLOADER) | 93 | #if CONFIG_BACKLIGHT && !defined(BOOTLOADER) |
94 | 94 | ||
95 | const signed char backlight_timeout_value[19] = | 95 | const signed char backlight_timeout_value[19] = |
96 | { | 96 | { |
@@ -804,10 +804,10 @@ void backlight_set_brightness(int val) | |||
804 | } | 804 | } |
805 | #endif /* HAVE_BACKLIGHT_BRIGHTNESS */ | 805 | #endif /* HAVE_BACKLIGHT_BRIGHTNESS */ |
806 | 806 | ||
807 | #else /* !defined(CONFIG_BACKLIGHT) || defined(BOOTLOADER) | 807 | #else /* (CONFIG_BACKLIGHT == 0) || defined(BOOTLOADER) |
808 | -- no backlight, empty dummy functions */ | 808 | -- no backlight, empty dummy functions */ |
809 | 809 | ||
810 | #if defined(BOOTLOADER) && defined(CONFIG_BACKLIGHT) | 810 | #if defined(BOOTLOADER) && CONFIG_BACKLIGHT |
811 | void backlight_init(void) | 811 | void backlight_init(void) |
812 | { | 812 | { |
813 | #ifdef __BACKLIGHT_INIT | 813 | #ifdef __BACKLIGHT_INIT |
@@ -830,4 +830,4 @@ bool is_remote_backlight_on(void) {return true;} | |||
830 | #ifdef HAVE_BACKLIGHT_BRIGHTNESS | 830 | #ifdef HAVE_BACKLIGHT_BRIGHTNESS |
831 | void backlight_set_brightness(int val) { (void)val; } | 831 | void backlight_set_brightness(int val) { (void)val; } |
832 | #endif | 832 | #endif |
833 | #endif /* defined(CONFIG_BACKLIGHT) && !defined(BOOTLOADER) */ | 833 | #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 */ | |||
43 | #ifdef HAVE_LCD_BITMAP | 43 | #ifdef HAVE_LCD_BITMAP |
44 | static bool flipped; /* buttons can be flipped to match the LCD flip */ | 44 | static bool flipped; /* buttons can be flipped to match the LCD flip */ |
45 | #endif | 45 | #endif |
46 | #ifdef CONFIG_BACKLIGHT | 46 | #if CONFIG_BACKLIGHT |
47 | static bool filter_first_keypress; | 47 | static bool filter_first_keypress; |
48 | #ifdef HAVE_REMOTE_LCD | 48 | #ifdef HAVE_REMOTE_LCD |
49 | static bool remote_filter_first_keypress; | 49 | static bool remote_filter_first_keypress; |
@@ -71,7 +71,7 @@ static void button_tick(void) | |||
71 | static int repeat_count = 0; | 71 | static int repeat_count = 0; |
72 | static bool repeat = false; | 72 | static bool repeat = false; |
73 | static bool post = false; | 73 | static bool post = false; |
74 | #ifdef CONFIG_BACKLIGHT | 74 | #if CONFIG_BACKLIGHT |
75 | static bool skip_release = false; | 75 | static bool skip_release = false; |
76 | #ifdef HAVE_REMOTE_LCD | 76 | #ifdef HAVE_REMOTE_LCD |
77 | static bool skip_remote_release = false; | 77 | static bool skip_remote_release = false; |
@@ -112,7 +112,7 @@ static void button_tick(void) | |||
112 | diff = btn ^ lastbtn; | 112 | diff = btn ^ lastbtn; |
113 | if(diff && (btn & diff) == 0) | 113 | if(diff && (btn & diff) == 0) |
114 | { | 114 | { |
115 | #ifdef CONFIG_BACKLIGHT | 115 | #if CONFIG_BACKLIGHT |
116 | #ifdef HAVE_REMOTE_LCD | 116 | #ifdef HAVE_REMOTE_LCD |
117 | if(diff & BUTTON_REMOTE) | 117 | if(diff & BUTTON_REMOTE) |
118 | if(!skip_remote_release) | 118 | if(!skip_remote_release) |
@@ -202,7 +202,7 @@ static void button_tick(void) | |||
202 | if (queue_empty(&button_queue)) | 202 | if (queue_empty(&button_queue)) |
203 | { | 203 | { |
204 | queue_post(&button_queue, BUTTON_REPEAT | btn, 0); | 204 | queue_post(&button_queue, BUTTON_REPEAT | btn, 0); |
205 | #ifdef CONFIG_BACKLIGHT | 205 | #if CONFIG_BACKLIGHT |
206 | #ifdef HAVE_REMOTE_LCD | 206 | #ifdef HAVE_REMOTE_LCD |
207 | skip_remote_release = false; | 207 | skip_remote_release = false; |
208 | #endif | 208 | #endif |
@@ -213,7 +213,7 @@ static void button_tick(void) | |||
213 | } | 213 | } |
214 | else | 214 | else |
215 | { | 215 | { |
216 | #ifdef CONFIG_BACKLIGHT | 216 | #if CONFIG_BACKLIGHT |
217 | #ifdef HAVE_REMOTE_LCD | 217 | #ifdef HAVE_REMOTE_LCD |
218 | if (btn & BUTTON_REMOTE) { | 218 | if (btn & BUTTON_REMOTE) { |
219 | if (!remote_filter_first_keypress || is_remote_backlight_on() | 219 | if (!remote_filter_first_keypress || is_remote_backlight_on() |
@@ -288,7 +288,7 @@ void button_init(void) | |||
288 | #ifdef HAVE_LCD_BITMAP | 288 | #ifdef HAVE_LCD_BITMAP |
289 | flipped = false; | 289 | flipped = false; |
290 | #endif | 290 | #endif |
291 | #ifdef CONFIG_BACKLIGHT | 291 | #if CONFIG_BACKLIGHT |
292 | filter_first_keypress = false; | 292 | filter_first_keypress = false; |
293 | #ifdef HAVE_REMOTE_LCD | 293 | #ifdef HAVE_REMOTE_LCD |
294 | remote_filter_first_keypress = false; | 294 | remote_filter_first_keypress = false; |
@@ -360,7 +360,7 @@ void button_set_flip(bool flip) | |||
360 | } | 360 | } |
361 | #endif /* HAVE_LCD_BITMAP */ | 361 | #endif /* HAVE_LCD_BITMAP */ |
362 | 362 | ||
363 | #ifdef CONFIG_BACKLIGHT | 363 | #if CONFIG_BACKLIGHT |
364 | void set_backlight_filter_keypress(bool value) | 364 | void set_backlight_filter_keypress(bool value) |
365 | { | 365 | { |
366 | filter_first_keypress = value; | 366 | 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); | |||
26 | void backlight_off(void); | 26 | void backlight_off(void); |
27 | void backlight_set_timeout(int index); | 27 | void backlight_set_timeout(int index); |
28 | 28 | ||
29 | #ifdef CONFIG_BACKLIGHT | 29 | #if CONFIG_BACKLIGHT |
30 | void backlight_init(void); | 30 | void backlight_init(void); |
31 | 31 | ||
32 | #if defined(IAUDIO_X5) && !defined(SIMULATOR) | 32 | #if defined(IAUDIO_X5) && !defined(SIMULATOR) |
@@ -54,7 +54,7 @@ void lcd_set_sleep_after_backlight_off(int index); | |||
54 | extern const signed char lcd_sleep_timeout_value[]; | 54 | extern const signed char lcd_sleep_timeout_value[]; |
55 | #endif | 55 | #endif |
56 | 56 | ||
57 | #else /* ndef CONFIG_BACKLIGHT */ | 57 | #else /* CONFIG_BACKLIGHT == 0 */ |
58 | #define backlight_init() | 58 | #define backlight_init() |
59 | #endif /* CONFIG_BACKLIGHT */ | 59 | #endif /* CONFIG_BACKLIGHT */ |
60 | 60 | ||
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 @@ | |||
1 | |||
2 | /*************************************************************************** | 1 | /*************************************************************************** |
3 | * __________ __ ___. | 2 | * __________ __ ___. |
4 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | 3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ |
@@ -34,7 +33,7 @@ void button_clear_queue(void); | |||
34 | #ifdef HAVE_LCD_BITMAP | 33 | #ifdef HAVE_LCD_BITMAP |
35 | void button_set_flip(bool flip); /* turn 180 degrees */ | 34 | void button_set_flip(bool flip); /* turn 180 degrees */ |
36 | #endif | 35 | #endif |
37 | #ifdef CONFIG_BACKLIGHT | 36 | #if CONFIG_BACKLIGHT |
38 | void set_backlight_filter_keypress(bool value); | 37 | void set_backlight_filter_keypress(bool value); |
39 | #ifdef HAVE_REMOTE_LCD | 38 | #ifdef HAVE_REMOTE_LCD |
40 | void set_remote_backlight_filter_keypress(bool value); | 39 | 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 @@ | |||
230 | #define CONFIG_LED 0 | 230 | #define CONFIG_LED 0 |
231 | #endif | 231 | #endif |
232 | 232 | ||
233 | #ifndef CONFIG_BACKLIGHT | ||
234 | #define CONFIG_BACKLIGHT 0 | ||
235 | #endif | ||
236 | |||
233 | #ifndef CONFIG_CHARGING | 237 | #ifndef CONFIG_CHARGING |
234 | #define CONFIG_CHARGING 0 | 238 | #define CONFIG_CHARGING 0 |
235 | #endif | 239 | #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) | |||
702 | current = CURRENT_USB; | 702 | current = CURRENT_USB; |
703 | } | 703 | } |
704 | 704 | ||
705 | #if defined(CONFIG_BACKLIGHT) && !defined(BOOTLOADER) | 705 | #if CONFIG_BACKLIGHT && !defined(BOOTLOADER) |
706 | if (backlight_get_current_timeout() == 0) /* LED always on */ | 706 | if (backlight_get_current_timeout() == 0) /* LED always on */ |
707 | current += CURRENT_BACKLIGHT; | 707 | current += CURRENT_BACKLIGHT; |
708 | #endif | 708 | #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; | |||
49 | 49 | ||
50 | static int btn = 0; /* Hopefully keeps track of currently pressed keys... */ | 50 | static int btn = 0; /* Hopefully keeps track of currently pressed keys... */ |
51 | 51 | ||
52 | #ifdef CONFIG_BACKLIGHT | 52 | #if CONFIG_BACKLIGHT |
53 | static bool filter_first_keypress; | 53 | static bool filter_first_keypress; |
54 | 54 | ||
55 | void set_backlight_filter_keypress(bool value) | 55 | void set_backlight_filter_keypress(bool value) |
@@ -76,7 +76,7 @@ void button_event(int key, bool pressed) | |||
76 | static int repeat_count = 0; | 76 | static int repeat_count = 0; |
77 | static bool repeat = false; | 77 | static bool repeat = false; |
78 | static bool post = false; | 78 | static bool post = false; |
79 | #ifdef CONFIG_BACKLIGHT | 79 | #if CONFIG_BACKLIGHT |
80 | static bool skip_release = false; | 80 | static bool skip_release = false; |
81 | #ifdef HAVE_REMOTE_LCD | 81 | #ifdef HAVE_REMOTE_LCD |
82 | static bool skip_remote_release = false; | 82 | static bool skip_remote_release = false; |
@@ -520,7 +520,7 @@ void button_event(int key, bool pressed) | |||
520 | diff = btn ^ lastbtn; | 520 | diff = btn ^ lastbtn; |
521 | if(diff && (btn & diff) == 0) | 521 | if(diff && (btn & diff) == 0) |
522 | { | 522 | { |
523 | #ifdef CONFIG_BACKLIGHT | 523 | #if CONFIG_BACKLIGHT |
524 | #ifdef HAVE_REMOTE_LCD | 524 | #ifdef HAVE_REMOTE_LCD |
525 | if(diff & BUTTON_REMOTE) | 525 | if(diff & BUTTON_REMOTE) |
526 | if(!skip_remote_release) | 526 | if(!skip_remote_release) |
@@ -587,7 +587,7 @@ void button_event(int key, bool pressed) | |||
587 | if (queue_empty(&button_queue)) | 587 | if (queue_empty(&button_queue)) |
588 | { | 588 | { |
589 | queue_post(&button_queue, BUTTON_REPEAT | btn, 0); | 589 | queue_post(&button_queue, BUTTON_REPEAT | btn, 0); |
590 | #ifdef CONFIG_BACKLIGHT | 590 | #if CONFIG_BACKLIGHT |
591 | #ifdef HAVE_REMOTE_LCD | 591 | #ifdef HAVE_REMOTE_LCD |
592 | if(btn & BUTTON_REMOTE) | 592 | if(btn & BUTTON_REMOTE) |
593 | { | 593 | { |
@@ -604,7 +604,7 @@ void button_event(int key, bool pressed) | |||
604 | } | 604 | } |
605 | else | 605 | else |
606 | { | 606 | { |
607 | #ifdef CONFIG_BACKLIGHT | 607 | #if CONFIG_BACKLIGHT |
608 | #ifdef HAVE_REMOTE_LCD | 608 | #ifdef HAVE_REMOTE_LCD |
609 | if (btn & BUTTON_REMOTE) { | 609 | if (btn & BUTTON_REMOTE) { |
610 | if (!remote_filter_first_keypress || is_remote_backlight_on()) | 610 | 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; | |||
25 | int lcd_backlight_val; | 25 | int lcd_backlight_val; |
26 | 26 | ||
27 | #if LCD_DEPTH <= 8 | 27 | #if LCD_DEPTH <= 8 |
28 | #ifdef CONFIG_BACKLIGHT | 28 | #if CONFIG_BACKLIGHT |
29 | SDL_Color lcd_backlight_color_zero = {UI_LCD_BGCOLORLIGHT, 0}; | 29 | SDL_Color lcd_backlight_color_zero = {UI_LCD_BGCOLORLIGHT, 0}; |
30 | #endif | 30 | #endif |
31 | SDL_Color lcd_color_zero = {UI_LCD_BGCOLOR, 0}; | 31 | 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) | |||
71 | LCD_HEIGHT, background ? UI_LCD_POSX : 0, background? UI_LCD_POSY : 0); | 71 | LCD_HEIGHT, background ? UI_LCD_POSX : 0, background? UI_LCD_POSY : 0); |
72 | } | 72 | } |
73 | 73 | ||
74 | #ifdef CONFIG_BACKLIGHT | 74 | #if CONFIG_BACKLIGHT |
75 | void sim_backlight(int value) | 75 | void sim_backlight(int value) |
76 | { | 76 | { |
77 | lcd_backlight_val = value; | 77 | lcd_backlight_val = value; |
@@ -118,7 +118,7 @@ void sim_lcd_init(void) | |||
118 | #endif | 118 | #endif |
119 | 119 | ||
120 | #if LCD_DEPTH <= 8 | 120 | #if LCD_DEPTH <= 8 |
121 | #ifdef CONFIG_BACKLIGHT | 121 | #if CONFIG_BACKLIGHT |
122 | sdl_set_gradient(lcd_surface, &lcd_backlight_color_zero, &lcd_color_max, | 122 | sdl_set_gradient(lcd_surface, &lcd_backlight_color_zero, &lcd_color_max, |
123 | 0, (1<<LCD_DEPTH)); | 123 | 0, (1<<LCD_DEPTH)); |
124 | #else | 124 | #else |
@@ -134,7 +134,7 @@ void sim_lcd_ex_init(int shades, unsigned long (*getpixel)(int, int)) | |||
134 | lcd_ex_shades = shades; | 134 | lcd_ex_shades = shades; |
135 | lcd_ex_getpixel = getpixel; | 135 | lcd_ex_getpixel = getpixel; |
136 | if (shades) { | 136 | if (shades) { |
137 | #ifdef CONFIG_BACKLIGHT | 137 | #if CONFIG_BACKLIGHT |
138 | if (lcd_backlight_val > 0) { | 138 | if (lcd_backlight_val > 0) { |
139 | sdl_set_gradient(lcd_surface, &lcd_color_max, | 139 | sdl_set_gradient(lcd_surface, &lcd_color_max, |
140 | &lcd_backlight_color_zero, (1<<LCD_DEPTH), | 140 | &lcd_backlight_color_zero, (1<<LCD_DEPTH), |
diff --git a/uisimulator/sdl/lcd-charcell.c b/uisimulator/sdl/lcd-charcell.c index 59ae39a248..cb31d6349b 100644 --- a/uisimulator/sdl/lcd-charcell.c +++ b/uisimulator/sdl/lcd-charcell.c | |||
@@ -114,7 +114,7 @@ void drawrectangles(int color, struct rectangle *points, int count) | |||
114 | SDL_UnlockSurface(lcd_surface); | 114 | SDL_UnlockSurface(lcd_surface); |
115 | } | 115 | } |
116 | 116 | ||
117 | #ifdef CONFIG_BACKLIGHT | 117 | #if CONFIG_BACKLIGHT |
118 | void sim_backlight(int value) | 118 | void sim_backlight(int value) |
119 | { | 119 | { |
120 | if (value > 0) { | 120 | if (value > 0) { |