From 8f7f219dbabee320862cb7ed8616300d54f935cb Mon Sep 17 00:00:00 2001 From: Jonathan Gordon Date: Wed, 29 Oct 2008 06:11:33 +0000 Subject: 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 --- .../target/arm/as3525/sansa-e200v2/backlight-e200v2.c | 6 ++++-- firmware/target/arm/as3525/sansa-e200v2/lcd-e200v2.c | 17 +++++------------ 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/firmware/target/arm/as3525/sansa-e200v2/backlight-e200v2.c b/firmware/target/arm/as3525/sansa-e200v2/backlight-e200v2.c index fd2b65ad5b..735b85667d 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 _backlight_off(void) 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 c4b300ac94..7a5c1156ff 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 @@ void lcd_init_device(void) 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 @@ void lcd_update(void) /* 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 @@ void lcd_update_rect(int x, int y, int width, int height) 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); -- cgit v1.2.3