1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
Index: firmware/target/arm/as3525/sansa-e200v2/lcd-e200v2.c
===================================================================
--- firmware/target/arm/as3525/sansa-e200v2/lcd-e200v2.c	(Revision 20060)
+++ firmware/target/arm/as3525/sansa-e200v2/lcd-e200v2.c	(Arbeitskopie)
@@ -363,17 +363,13 @@
     (void)height;
 }

-static void lcd_window_x(int xmin, int xmax)
+static void lcd_window(int xmin, int xmax, int ymin, int ymax)
 {
-    lcd_write_reg(R_HORIZ_RAM_ADDR_POS, (xmax << 8) | xmin);
-}
-
-static void lcd_window_y(int ymin, int ymax)
-{
     ymin += y_offset;
     ymax += y_offset;
+    lcd_write_reg(R_HORIZ_RAM_ADDR_POS, (xmax << 8) | xmin);
     lcd_write_reg(R_VERT_RAM_ADDR_POS, (ymax << 8) | ymin);
-    lcd_write_reg(R_RAM_ADDR_SET, ymin << 8);
+    lcd_write_reg(R_RAM_ADDR_SET, ymin << 8|xmin);
 }
 /* Update the display.
    This must be called after all other LCD functions that change the display. */
@@ -386,8 +382,7 @@

     lcd_busy = true;
     /* Set start position and window */
-    lcd_window_x(0, LCD_WIDTH-1);
-    lcd_window_x(0, LCD_HEIGHT-1);
+    lcd_window(0, LCD_WIDTH-1, 0, LCD_HEIGHT-1);

     lcd_write_cmd(R_WRITE_DATA_2_GRAM);

@@ -425,8 +420,7 @@
     lcd_busy = true;

     lcd_write_cmd(R_WRITE_DATA_2_GRAM);
-    lcd_window_x(x, x + width);
-    lcd_window_y(y, ymax);
+    lcd_window(x, x+width, y, ymax);

     ptr = &lcd_framebuffer[y][x];

@@ -450,8 +444,7 @@

     lcd_write_reg(R_ENTRY_MODE, R_ENTRY_MODE_HORZ);
     /* Set start position and window */
-    lcd_window_x(LCD_WIDTH+1, 1);
-    lcd_window_y(LCD_HEIGHT+1, 1);
+    lcd_window_y(LCD_WIDTH+1, 1, LCD_HEIGHT+1, 1);

     lcd_write_cmd(R_WRITE_DATA_2_GRAM);