FS#9511 - working lcd update (and lcd_update_rect() ) for the e200v2, working button light also


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18914 a1c6a512-1295-4272-9138-f99709370657
diff --git a/firmware/target/arm/as3525/sansa-e200v2/backlight-e200v2.c b/firmware/target/arm/as3525/sansa-e200v2/backlight-e200v2.c
index fd2b65a..735b856 100644
--- a/firmware/target/arm/as3525/sansa-e200v2/backlight-e200v2.c
+++ b/firmware/target/arm/as3525/sansa-e200v2/backlight-e200v2.c
@@ -62,10 +62,12 @@
 
 void _buttonlight_on(void)
 {
-    /* TODO */
+    GPIOD_PIN(7) = (1<<7);
+    GPIOD_DIR |= (1<<7);
 }
 
 void _buttonlight_off(void)
 {
-    /* TODO */
+    GPIOD_PIN(7) = 0;
+    GPIOD_DIR |= (1<<7);
 }
diff --git a/firmware/target/arm/as3525/sansa-e200v2/lcd-e200v2.c b/firmware/target/arm/as3525/sansa-e200v2/lcd-e200v2.c
index c4b300a..7a5c115 100644
--- a/firmware/target/arm/as3525/sansa-e200v2/lcd-e200v2.c
+++ b/firmware/target/arm/as3525/sansa-e200v2/lcd-e200v2.c
@@ -307,14 +307,6 @@
 
     GPIOD_DIR |= (1<<7);
 
-#if 0
-    /* TODO: This code is conditional on a variable in the OF init, we need to
-       work out what it means */
-
-    GPIOD_PIN(7) = (1<<7);
-    GPIOD_DIR |= (1<<7);
-#endif
-
     lcd_delay(1);
 
     GPIOA_PIN(5) = (1<<5);
@@ -377,13 +369,14 @@
 
     /* Set start position and window */
     lcd_write_reg(R_HORIZ_RAM_ADDR_POS, 
-                  ((y_offset + LCD_HEIGHT-1) << 8) | y_offset);
-    lcd_write_reg(R_VERT_RAM_ADDR_POS, (LCD_WIDTH-1) << 8);
+                  ((y_offset + LCD_WIDTH-1) << 8) | y_offset);
+    lcd_write_reg(R_VERT_RAM_ADDR_POS, (LCD_HEIGHT-1) << 8);
     lcd_write_reg(R_RAM_ADDR_SET, y_offset);
 
     lcd_write_cmd(R_WRITE_DATA_2_GRAM);
 
     lcd_write_data((unsigned short *)lcd_framebuffer, LCD_WIDTH*LCD_HEIGHT);
+    
 } /* lcd_update */
 
 
@@ -414,8 +407,8 @@
     lcd_write_reg(R_ENTRY_MODE, R_ENTRY_MODE_HORZ);
     /* Set start position and window */
     lcd_write_reg(R_HORIZ_RAM_ADDR_POS, 
-                  ((y_offset + LCD_HEIGHT-1) << 8) | y_offset);
-    lcd_write_reg(R_VERT_RAM_ADDR_POS, ((x + width - 1) << 8) | x);
+                  ((y_offset + LCD_WIDTH-1) << 8) | y_offset);
+    lcd_write_reg(R_VERT_RAM_ADDR_POS, ((y + height - 1) << 8) | y);
     lcd_write_reg(R_RAM_ADDR_SET, (x << 8) | (y + y_offset));
 
     lcd_write_cmd(R_WRITE_DATA_2_GRAM);