summaryrefslogtreecommitdiff
path: root/firmware/target/arm/as3525/sansa-e200v2/lcd-e200v2.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/as3525/sansa-e200v2/lcd-e200v2.c')
-rw-r--r--firmware/target/arm/as3525/sansa-e200v2/lcd-e200v2.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/firmware/target/arm/as3525/sansa-e200v2/lcd-e200v2.c b/firmware/target/arm/as3525/sansa-e200v2/lcd-e200v2.c
index f157b552e4..98ed8421f6 100644
--- a/firmware/target/arm/as3525/sansa-e200v2/lcd-e200v2.c
+++ b/firmware/target/arm/as3525/sansa-e200v2/lcd-e200v2.c
@@ -369,10 +369,10 @@ void lcd_update(void)
369 lcd_write_reg(R_ENTRY_MODE, R_ENTRY_MODE_HORZ); 369 lcd_write_reg(R_ENTRY_MODE, R_ENTRY_MODE_HORZ);
370 370
371 /* Set start position and window */ 371 /* Set start position and window */
372 lcd_write_reg(R_HORIZ_RAM_ADDR_POS, 372 lcd_write_reg(R_HORIZ_RAM_ADDR_POS, (LCD_WIDTH-1) << 8);
373 ((y_offset + LCD_WIDTH-1) << 8) | y_offset); 373 lcd_write_reg(R_VERT_RAM_ADDR_POS,
374 lcd_write_reg(R_VERT_RAM_ADDR_POS, (LCD_HEIGHT-1) << 8); 374 ((y_offset + LCD_HEIGHT-1) << 8) | y_offset);
375 lcd_write_reg(R_RAM_ADDR_SET, y_offset); 375 lcd_write_reg(R_RAM_ADDR_SET, (y_offset) << 8);
376 376
377 lcd_write_cmd(R_WRITE_DATA_2_GRAM); 377 lcd_write_cmd(R_WRITE_DATA_2_GRAM);
378 378
@@ -408,9 +408,10 @@ void lcd_update_rect(int x, int y, int width, int height)
408 lcd_write_reg(R_ENTRY_MODE, R_ENTRY_MODE_HORZ); 408 lcd_write_reg(R_ENTRY_MODE, R_ENTRY_MODE_HORZ);
409 /* Set start position and window */ 409 /* Set start position and window */
410 lcd_write_reg(R_HORIZ_RAM_ADDR_POS, 410 lcd_write_reg(R_HORIZ_RAM_ADDR_POS,
411 ((y_offset + LCD_WIDTH-1) << 8) | y_offset); 411 ((x + width-1) << 8) | x);
412 lcd_write_reg(R_VERT_RAM_ADDR_POS, ((y + height - 1) << 8) | y); 412 lcd_write_reg(R_VERT_RAM_ADDR_POS,
413 lcd_write_reg(R_RAM_ADDR_SET, (x << 8) | (y + y_offset)); 413 ((y_offset + y + height - 1) << 8) | (y_offset + y));
414 lcd_write_reg(R_RAM_ADDR_SET, ((y + y_offset) << 8) | x);
414 415
415 lcd_write_cmd(R_WRITE_DATA_2_GRAM); 416 lcd_write_cmd(R_WRITE_DATA_2_GRAM);
416 417