summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBertrik Sikken <bertrik@sikken.nl>2008-08-05 20:17:17 +0000
committerBertrik Sikken <bertrik@sikken.nl>2008-08-05 20:17:17 +0000
commitf2213c8fc26c94f091563aa4d8ca96f1369f079d (patch)
tree23908ab6d5f6098d9867dc7346d294490cb128f7
parentb0b72a84ffd1d743e98030fdd30a8d4d527f4766 (diff)
downloadrockbox-f2213c8fc26c94f091563aa4d8ca96f1369f079d.tar.gz
rockbox-f2213c8fc26c94f091563aa4d8ca96f1369f079d.zip
Apply FS#9195 (LCD disable for sansa c200), which puts the sansa c200 display controller in standby when the backlight is turned off and thereby improves runtime. I measured 40 minutes improvement over a runtime of about 14h.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18198 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/export/config-c200.h2
-rw-r--r--firmware/target/arm/sandisk/sansa-c200/lcd-c200.c24
2 files changed, 25 insertions, 1 deletions
diff --git a/firmware/export/config-c200.h b/firmware/export/config-c200.h
index 81b79373e4..d7b8e7e824 100644
--- a/firmware/export/config-c200.h
+++ b/firmware/export/config-c200.h
@@ -48,7 +48,7 @@
48#define LCD_PIXELFORMAT RGB565 /* rgb565 */ 48#define LCD_PIXELFORMAT RGB565 /* rgb565 */
49 49
50/* define this if you have LCD enable function */ 50/* define this if you have LCD enable function */
51/* TODO: #define HAVE_LCD_ENABLE */ 51#define HAVE_LCD_ENABLE
52 52
53/* Define this if your LCD can be put to sleep. HAVE_LCD_ENABLE 53/* Define this if your LCD can be put to sleep. HAVE_LCD_ENABLE
54 should be defined as well. */ 54 should be defined as well. */
diff --git a/firmware/target/arm/sandisk/sansa-c200/lcd-c200.c b/firmware/target/arm/sandisk/sansa-c200/lcd-c200.c
index fc936b1287..9e7c81e20d 100644
--- a/firmware/target/arm/sandisk/sansa-c200/lcd-c200.c
+++ b/firmware/target/arm/sandisk/sansa-c200/lcd-c200.c
@@ -26,6 +26,7 @@
26 26
27/* Display status */ 27/* Display status */
28static unsigned lcd_yuv_options SHAREDBSS_ATTR = 0; 28static unsigned lcd_yuv_options SHAREDBSS_ATTR = 0;
29static bool is_lcd_enabled = true;
29 30
30/* LCD command set for Samsung S6B33B2 */ 31/* LCD command set for Samsung S6B33B2 */
31 32
@@ -189,6 +190,29 @@ void lcd_set_invert_display(bool yesno)
189 (void)yesno; 190 (void)yesno;
190} 191}
191 192
193void lcd_enable(bool yesno)
194{
195 if (yesno == is_lcd_enabled)
196 return;
197
198 if (yesno)
199 {
200 lcd_send_command(R_STANDBY_OFF);
201 lcd_send_command(R_DISPLAY_ON);
202 }
203 else
204 {
205 lcd_send_command(R_STANDBY_ON);
206 }
207 is_lcd_enabled = yesno;
208}
209
210bool lcd_enabled(void)
211{
212 return is_lcd_enabled;
213}
214
215
192/* turn the display upside down (call lcd_update() afterwards) */ 216/* turn the display upside down (call lcd_update() afterwards) */
193void lcd_set_flip(bool yesno) 217void lcd_set_flip(bool yesno)
194{ 218{