diff options
author | Jens Arnold <amiconn@rockbox.org> | 2006-07-25 11:15:50 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2006-07-25 11:15:50 +0000 |
commit | 9051afa8a061152941ed4cf99e0ceb9bc4a3caf1 (patch) | |
tree | 40883fe94c814baadeb6a08d0060dd3c8dea7015 /firmware | |
parent | 7136fd9bb6f589ae873057aa9731c45f17a7b339 (diff) | |
download | rockbox-9051afa8a061152941ed4cf99e0ceb9bc4a3caf1.tar.gz rockbox-9051afa8a061152941ed4cf99e0ceb9bc4a3caf1.zip |
Contrast setting cleanup: * Only include contrast setting for targets where it's used. * Make lcd_default_contrast() a stub for simulators.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10317 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/drivers/lcd-16bit.c | 8 | ||||
-rw-r--r-- | firmware/drivers/lcd-2bit-horz.c | 9 | ||||
-rw-r--r-- | firmware/drivers/lcd-h100.c | 4 | ||||
-rw-r--r-- | firmware/drivers/lcd-ipod.c | 9 | ||||
-rw-r--r-- | firmware/drivers/lcd-player.c | 10 | ||||
-rw-r--r-- | firmware/drivers/lcd-recorder.c | 8 |
6 files changed, 19 insertions, 29 deletions
diff --git a/firmware/drivers/lcd-16bit.c b/firmware/drivers/lcd-16bit.c index 4297937abd..d237dac858 100644 --- a/firmware/drivers/lcd-16bit.c +++ b/firmware/drivers/lcd-16bit.c | |||
@@ -72,14 +72,6 @@ static const char scroll_tick_table[16] = { | |||
72 | 100, 80, 64, 50, 40, 32, 25, 20, 16, 12, 10, 8, 6, 5, 4, 3 | 72 | 100, 80, 64, 50, 40, 32, 25, 20, 16, 12, 10, 8, 6, 5, 4, 3 |
73 | }; | 73 | }; |
74 | 74 | ||
75 | #ifndef TARGET_TREE | ||
76 | /* probably just a dummy */ | ||
77 | int lcd_default_contrast(void) | ||
78 | { | ||
79 | return 28; | ||
80 | } | ||
81 | #endif | ||
82 | |||
83 | /* LCD init */ | 75 | /* LCD init */ |
84 | void lcd_init(void) | 76 | void lcd_init(void) |
85 | { | 77 | { |
diff --git a/firmware/drivers/lcd-2bit-horz.c b/firmware/drivers/lcd-2bit-horz.c index e70df3fb84..4ee2e2ea28 100644 --- a/firmware/drivers/lcd-2bit-horz.c +++ b/firmware/drivers/lcd-2bit-horz.c | |||
@@ -79,15 +79,6 @@ void lcd_init(void) | |||
79 | sizeof(scroll_stack), scroll_name); | 79 | sizeof(scroll_stack), scroll_name); |
80 | } | 80 | } |
81 | 81 | ||
82 | int lcd_default_contrast(void) | ||
83 | { | ||
84 | #if defined(IPOD_MINI) || defined(IPOD_MINI2G) | ||
85 | return 42; | ||
86 | #else | ||
87 | return 35; | ||
88 | #endif | ||
89 | } | ||
90 | |||
91 | /*** parameter handling ***/ | 82 | /*** parameter handling ***/ |
92 | 83 | ||
93 | void lcd_set_drawmode(int mode) | 84 | void lcd_set_drawmode(int mode) |
diff --git a/firmware/drivers/lcd-h100.c b/firmware/drivers/lcd-h100.c index f460165534..369833944f 100644 --- a/firmware/drivers/lcd-h100.c +++ b/firmware/drivers/lcd-h100.c | |||
@@ -102,13 +102,13 @@ static const char scroll_tick_table[16] = { | |||
102 | 102 | ||
103 | /*** hardware configuration ***/ | 103 | /*** hardware configuration ***/ |
104 | 104 | ||
105 | #ifndef SIMULATOR | ||
106 | |||
105 | int lcd_default_contrast(void) | 107 | int lcd_default_contrast(void) |
106 | { | 108 | { |
107 | return 28; | 109 | return 28; |
108 | } | 110 | } |
109 | 111 | ||
110 | #ifndef SIMULATOR | ||
111 | |||
112 | void lcd_set_contrast(int val) | 112 | void lcd_set_contrast(int val) |
113 | { | 113 | { |
114 | lcd_write_command_ex(LCD_CNTL_ELECTRONIC_VOLUME, val, -1); | 114 | lcd_write_command_ex(LCD_CNTL_ELECTRONIC_VOLUME, val, -1); |
diff --git a/firmware/drivers/lcd-ipod.c b/firmware/drivers/lcd-ipod.c index 67f9e7c23f..6500335e04 100644 --- a/firmware/drivers/lcd-ipod.c +++ b/firmware/drivers/lcd-ipod.c | |||
@@ -146,6 +146,15 @@ void lcd_init_device(void) | |||
146 | 146 | ||
147 | /*** hardware configuration ***/ | 147 | /*** hardware configuration ***/ |
148 | 148 | ||
149 | int lcd_default_contrast(void) | ||
150 | { | ||
151 | #if defined(IPOD_MINI) || defined(IPOD_MINI2G) | ||
152 | return 42; | ||
153 | #else | ||
154 | return 35; | ||
155 | #endif | ||
156 | } | ||
157 | |||
149 | /* Rockbox stores the contrast as 0..63 - we add 64 to it */ | 158 | /* Rockbox stores the contrast as 0..63 - we add 64 to it */ |
150 | void lcd_set_contrast(int val) | 159 | void lcd_set_contrast(int val) |
151 | { | 160 | { |
diff --git a/firmware/drivers/lcd-player.c b/firmware/drivers/lcd-player.c index d01ec3447f..7da345279d 100644 --- a/firmware/drivers/lcd-player.c +++ b/firmware/drivers/lcd-player.c | |||
@@ -274,11 +274,6 @@ bool lcdx_putc(int x, int y, unsigned short ch) | |||
274 | return false; | 274 | return false; |
275 | } | 275 | } |
276 | 276 | ||
277 | int lcd_default_contrast(void) | ||
278 | { | ||
279 | return 30; | ||
280 | } | ||
281 | |||
282 | void lcd_clear_display(void) | 277 | void lcd_clear_display(void) |
283 | { | 278 | { |
284 | int i; | 279 | int i; |
@@ -483,6 +478,11 @@ void lcd_icon(int icon, bool enable) | |||
483 | lcd_write_data(&icon_mirror[pos], 1); | 478 | lcd_write_data(&icon_mirror[pos], 1); |
484 | } | 479 | } |
485 | 480 | ||
481 | int lcd_default_contrast(void) | ||
482 | { | ||
483 | return 30; | ||
484 | } | ||
485 | |||
486 | void lcd_set_contrast(int val) | 486 | void lcd_set_contrast(int val) |
487 | { | 487 | { |
488 | lcd_data_byte = (unsigned char) (31 - val); | 488 | lcd_data_byte = (unsigned char) (31 - val); |
diff --git a/firmware/drivers/lcd-recorder.c b/firmware/drivers/lcd-recorder.c index 22bfebe289..75faa18b28 100644 --- a/firmware/drivers/lcd-recorder.c +++ b/firmware/drivers/lcd-recorder.c | |||
@@ -157,11 +157,11 @@ void lcd_write_data( const unsigned char* data, int count ) | |||
157 | 157 | ||
158 | /*** hardware configuration ***/ | 158 | /*** hardware configuration ***/ |
159 | 159 | ||
160 | #ifndef SIMULATOR | ||
161 | |||
160 | int lcd_default_contrast(void) | 162 | int lcd_default_contrast(void) |
161 | { | 163 | { |
162 | #ifdef SIMULATOR | 164 | #if CONFIG_LCD == LCD_GMINI100 |
163 | return 30; | ||
164 | #elif CONFIG_LCD == LCD_GMINI100 | ||
165 | return 31; | 165 | return 31; |
166 | #elif CONFIG_LCD == LCD_IFP7XX | 166 | #elif CONFIG_LCD == LCD_IFP7XX |
167 | return 45; | 167 | return 45; |
@@ -170,8 +170,6 @@ int lcd_default_contrast(void) | |||
170 | #endif | 170 | #endif |
171 | } | 171 | } |
172 | 172 | ||
173 | #ifndef SIMULATOR | ||
174 | |||
175 | void lcd_set_contrast(int val) | 173 | void lcd_set_contrast(int val) |
176 | { | 174 | { |
177 | lcd_write_command(LCD_CNTL_CONTRAST); | 175 | lcd_write_command(LCD_CNTL_CONTRAST); |