Agptek rocker: do not update display when not active

Change-Id: I963a9098b82a09aed8050123932a128f2d08dee0
This commit is contained in:
Marcin Bukat 2019-05-31 15:17:33 +02:00
parent 2de2636d6b
commit e85a3ba518

View file

@ -114,14 +114,19 @@ extern void lcd_copy_buffer_rect(fb_data *dst, const fb_data *src,
void lcd_update(void) void lcd_update(void)
{ {
if (lcd_active())
{
/* Copy the Rockbox framebuffer to the second framebuffer */ /* Copy the Rockbox framebuffer to the second framebuffer */
lcd_copy_buffer_rect(LCD_FRAMEBUF_ADDR(0, 0), FBADDR(0,0), lcd_copy_buffer_rect(LCD_FRAMEBUF_ADDR(0, 0), FBADDR(0,0),
LCD_WIDTH*LCD_HEIGHT, 1); LCD_WIDTH*LCD_HEIGHT, 1);
redraw(); redraw();
}
} }
void lcd_update_rect(int x, int y, int width, int height) void lcd_update_rect(int x, int y, int width, int height)
{ {
if (lcd_active())
{
fb_data *dst = LCD_FRAMEBUF_ADDR(x, y); fb_data *dst = LCD_FRAMEBUF_ADDR(x, y);
fb_data * src = FBADDR(x,y); fb_data * src = FBADDR(x,y);
@ -137,4 +142,5 @@ void lcd_update_rect(int x, int y, int width, int height)
lcd_copy_buffer_rect(dst, src, LCD_WIDTH*height, 1); lcd_copy_buffer_rect(dst, src, LCD_WIDTH*height, 1);
} }
redraw(); redraw();
}
} }