diff --git a/firmware/target/arm/rk27xx/lcd-hifiman.c b/firmware/target/arm/rk27xx/lcd-hifiman.c index d98ed5a1c3..b97766c840 100644 --- a/firmware/target/arm/rk27xx/lcd-hifiman.c +++ b/firmware/target/arm/rk27xx/lcd-hifiman.c @@ -29,7 +29,7 @@ static bool display_on = false; -static void lcd_display_init(void) +static void lcd_v1_display_init(void) { unsigned int x, y; @@ -108,13 +108,7 @@ static void lcd_display_init(void) display_on = true; } -void lcd_init_device(void) -{ - lcdif_init(LCDIF_16BIT); - lcd_display_init(); -} - -void lcd_enable (bool on) +static void lcd_v1_enable (bool on) { if (on) { @@ -145,32 +139,185 @@ void lcd_enable (bool on) lcd_write_reg(0x21, 0x00); } display_on = on; +} + +static void lcd_v1_update_rect(int x, int y, int width, int height) +{ + int px = x, py = y; + int pxmax = x + width, pymax = y + height; + + lcd_write_reg(0x03, y); + lcd_write_reg(0x05, pymax-1); + lcd_write_reg(0x07, x); + lcd_write_reg(0x09, pxmax-1); + + lcd_cmd(0x22); + + for (px=x; px