summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafaël Carré <rafael.carre@gmail.com>2010-05-29 14:24:10 +0000
committerRafaël Carré <rafael.carre@gmail.com>2010-05-29 14:24:10 +0000
commit56220785c11d9ad62b552a8f1ba44d779d5edf48 (patch)
treef8d7bb0d8a87d0b6045ab300ff64663c5db92576
parente8ec20476f20841d9acb026dfb6cd49ba7e25766 (diff)
downloadrockbox-56220785c11d9ad62b552a8f1ba44d779d5edf48.tar.gz
rockbox-56220785c11d9ad62b552a8f1ba44d779d5edf48.zip
e200v2: revert r26353
invert setting isn't remembered when backlight goes off and lcd_enable() is ran again git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26374 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/target/arm/as3525/sansa-e200v2/lcd-e200v2.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/firmware/target/arm/as3525/sansa-e200v2/lcd-e200v2.c b/firmware/target/arm/as3525/sansa-e200v2/lcd-e200v2.c
index 438020fb68..5a4c58f5b3 100644
--- a/firmware/target/arm/as3525/sansa-e200v2/lcd-e200v2.c
+++ b/firmware/target/arm/as3525/sansa-e200v2/lcd-e200v2.c
@@ -79,6 +79,11 @@ static bool display_on = false; /* is the display turned on? */
79#define R_ENTRY_MODE_VERT 0x7038 79#define R_ENTRY_MODE_VERT 0x7038
80#define R_ENTRY_MODE_SOLID_VERT 0x1038 80#define R_ENTRY_MODE_SOLID_VERT 0x1038
81 81
82/* Reverse Flag */
83#define R_DISP_CONTROL_NORMAL 0x0004
84#define R_DISP_CONTROL_REV 0x0000
85static unsigned short r_disp_control_rev = R_DISP_CONTROL_NORMAL;
86
82static inline void lcd_delay(int x) 87static inline void lcd_delay(int x)
83{ 88{
84 do { 89 do {
@@ -143,9 +148,12 @@ void lcd_set_contrast(int val)
143 148
144void lcd_set_invert_display(bool yesno) 149void lcd_set_invert_display(bool yesno)
145{ 150{
151 r_disp_control_rev = yesno ? R_DISP_CONTROL_REV :
152 R_DISP_CONTROL_NORMAL;
153
146 if (display_on) 154 if (display_on)
147 { 155 {
148 lcd_write_reg(R_DISP_CONTROL1, yesno ? 0x33 : 0x37); 156 lcd_write_reg(R_DISP_CONTROL1, 0x0033 | r_disp_control_rev);
149 } 157 }
150 158
151} 159}
@@ -187,7 +195,7 @@ static void _display_on(void)
187 lcd_write_reg(R_COMPARE_REG2, 0); 195 lcd_write_reg(R_COMPARE_REG2, 0);
188 196
189 /* GON = 0, DTE = 0, D1-0 = 00b */ 197 /* GON = 0, DTE = 0, D1-0 = 00b */
190 lcd_write_reg(R_DISP_CONTROL1, 0x0000); 198 lcd_write_reg(R_DISP_CONTROL1, 0x0000 | r_disp_control_rev);
191 199
192 /* Front porch lines: 2; Back porch lines: 2; */ 200 /* Front porch lines: 2; Back porch lines: 2; */
193 lcd_write_reg(R_DISP_CONTROL2, 0x0203); 201 lcd_write_reg(R_DISP_CONTROL2, 0x0203);
@@ -261,7 +269,7 @@ static void _display_on(void)
261 lcd_write_reg(R_1ST_SCR_DRV_POS, (LCD_HEIGHT-1) << 8); 269 lcd_write_reg(R_1ST_SCR_DRV_POS, (LCD_HEIGHT-1) << 8);
262 lcd_write_reg(R_2ND_SCR_DRV_POS, (LCD_HEIGHT-1) << 8); 270 lcd_write_reg(R_2ND_SCR_DRV_POS, (LCD_HEIGHT-1) << 8);
263 271
264 lcd_write_reg(R_DISP_CONTROL1, 0x0037); 272 lcd_write_reg(R_DISP_CONTROL1, 0x0033 | r_disp_control_rev);
265 273
266 display_on = true; /* must be done before calling lcd_update() */ 274 display_on = true; /* must be done before calling lcd_update() */
267 lcd_update(); 275 lcd_update();