summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
authorMarcin Bukat <marcin.bukat@gmail.com>2019-05-31 15:17:33 +0200
committerMarcin Bukat <marcin.bukat@gmail.com>2019-05-31 15:17:33 +0200
commite85a3ba518c272daf9c0246872822fdde34754a6 (patch)
tree645ca23fa49884e241f19fa99f88d44892ee7a3e /firmware
parent2de2636d6bfc4fac94eee87696b8c2375d14648b (diff)
downloadrockbox-e85a3ba518c272daf9c0246872822fdde34754a6.tar.gz
rockbox-e85a3ba518c272daf9c0246872822fdde34754a6.tar.bz2
rockbox-e85a3ba518c272daf9c0246872822fdde34754a6.zip
Agptek rocker: do not update display when not active
Change-Id: I963a9098b82a09aed8050123932a128f2d08dee0
Diffstat (limited to 'firmware')
-rw-r--r--firmware/target/hosted/agptek/lcd-agptek.c40
1 files changed, 23 insertions, 17 deletions
diff --git a/firmware/target/hosted/agptek/lcd-agptek.c b/firmware/target/hosted/agptek/lcd-agptek.c
index 4b3148da03..9cd4daea5d 100644
--- a/firmware/target/hosted/agptek/lcd-agptek.c
+++ b/firmware/target/hosted/agptek/lcd-agptek.c
@@ -114,27 +114,33 @@ extern void lcd_copy_buffer_rect(fb_data *dst, const fb_data *src,
void lcd_update(void)
{
- /* Copy the Rockbox framebuffer to the second framebuffer */
- lcd_copy_buffer_rect(LCD_FRAMEBUF_ADDR(0, 0), FBADDR(0,0),
- LCD_WIDTH*LCD_HEIGHT, 1);
- redraw();
+ if (lcd_active())
+ {
+ /* Copy the Rockbox framebuffer to the second framebuffer */
+ lcd_copy_buffer_rect(LCD_FRAMEBUF_ADDR(0, 0), FBADDR(0,0),
+ LCD_WIDTH*LCD_HEIGHT, 1);
+ redraw();
+ }
}
void lcd_update_rect(int x, int y, int width, int height)
{
- fb_data *dst = LCD_FRAMEBUF_ADDR(x, y);
- fb_data * src = FBADDR(x,y);
-
- /* Copy part of the Rockbox framebuffer to the second framebuffer */
- if (width < LCD_WIDTH)
- {
- /* Not full width - do line-by-line */
- lcd_copy_buffer_rect(dst, src, width, height);
- }
- else
+ if (lcd_active())
{
- /* Full width - copy as one line */
- lcd_copy_buffer_rect(dst, src, LCD_WIDTH*height, 1);
+ fb_data *dst = LCD_FRAMEBUF_ADDR(x, y);
+ fb_data * src = FBADDR(x,y);
+
+ /* Copy part of the Rockbox framebuffer to the second framebuffer */
+ if (width < LCD_WIDTH)
+ {
+ /* Not full width - do line-by-line */
+ lcd_copy_buffer_rect(dst, src, width, height);
+ }
+ else
+ {
+ /* Full width - copy as one line */
+ lcd_copy_buffer_rect(dst, src, LCD_WIDTH*height, 1);
+ }
+ redraw();
}
- redraw();
}