summaryrefslogtreecommitdiff
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
parent2de2636d6bfc4fac94eee87696b8c2375d14648b (diff)
downloadrockbox-e85a3ba518c272daf9c0246872822fdde34754a6.tar.gz
rockbox-e85a3ba518c272daf9c0246872822fdde34754a6.zip
Agptek rocker: do not update display when not active
Change-Id: I963a9098b82a09aed8050123932a128f2d08dee0
-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,
114 114
115void lcd_update(void) 115void lcd_update(void)
116{ 116{
117 /* Copy the Rockbox framebuffer to the second framebuffer */ 117 if (lcd_active())
118 lcd_copy_buffer_rect(LCD_FRAMEBUF_ADDR(0, 0), FBADDR(0,0), 118 {
119 LCD_WIDTH*LCD_HEIGHT, 1); 119 /* Copy the Rockbox framebuffer to the second framebuffer */
120 redraw(); 120 lcd_copy_buffer_rect(LCD_FRAMEBUF_ADDR(0, 0), FBADDR(0,0),
121 LCD_WIDTH*LCD_HEIGHT, 1);
122 redraw();
123 }
121} 124}
122 125
123void lcd_update_rect(int x, int y, int width, int height) 126void lcd_update_rect(int x, int y, int width, int height)
124{ 127{
125 fb_data *dst = LCD_FRAMEBUF_ADDR(x, y); 128 if (lcd_active())
126 fb_data * src = FBADDR(x,y);
127
128 /* Copy part of the Rockbox framebuffer to the second framebuffer */
129 if (width < LCD_WIDTH)
130 {
131 /* Not full width - do line-by-line */
132 lcd_copy_buffer_rect(dst, src, width, height);
133 }
134 else
135 { 129 {
136 /* Full width - copy as one line */ 130 fb_data *dst = LCD_FRAMEBUF_ADDR(x, y);
137 lcd_copy_buffer_rect(dst, src, LCD_WIDTH*height, 1); 131 fb_data * src = FBADDR(x,y);
132
133 /* Copy part of the Rockbox framebuffer to the second framebuffer */
134 if (width < LCD_WIDTH)
135 {
136 /* Not full width - do line-by-line */
137 lcd_copy_buffer_rect(dst, src, width, height);
138 }
139 else
140 {
141 /* Full width - copy as one line */
142 lcd_copy_buffer_rect(dst, src, LCD_WIDTH*height, 1);
143 }
144 redraw();
138 } 145 }
139 redraw();
140} 146}